/path/to/patch/fix_cflags.patch
4. ??? how to rebuild a gem from modified sources ? I cann’t find the
original gemspec.
5. ??? install modified gem with gem install ./gosu-0.7.45.gem
In this case is in github, so you can clone and even fork and do a
pull request to request your changes be in the next version for gosu.
regards
jordi
Ok, I can use the git sources and maybe install the libs with rake, but
still curious how to modify & rebuild the gem. I thought it has to be a
simple task.
??? how to rebuild a gem from modified sources ? I cann’t find the
original gemspec.
Doesn’t gem build work for you?
gem unpack --spec
Will retrieve the original gem spec from the gem. If you’ve added new
files you will need to update the gemspec.
Move this file into the unpacked gem directory then run gem build
??? install modified gem with gem install ./gosu-0.7.45.gem
gem install gosu --local.
Also, .gem files are just ZIP archives, you can unpack them with any
archiver and modify the contents.
.gem files are tar files which contain (at least) a gzipped YAML file
(metadata.gz, the gem spec) and a data.tar.gz (A gzipped tar file).
Tools that only handle zip will not unpack them.
??? how to rebuild a gem from modified sources ? I cann’t find the
original gemspec.
Doesn’t gem build work for you?
gem unpack --spec
I did missed this option. THAT’s the answer. Thank you.
Will retrieve the original gem spec from the gem. If you’ve added new
files you will need to update the gemspec.
Move this file into the unpacked gem directory then run gem build
??? install modified gem with gem install ./gosu-0.7.45.gem
gem install gosu --local.
Also, .gem files are just ZIP archives, you can unpack them with any
archiver and modify the contents.
.gem files are tar files which contain (at least) a gzipped YAML file
(metadata.gz, the gem spec) and a data.tar.gz (A gzipped tar file).
Tools that only handle zip will not unpack them.
Correct. In addition all files stored in gem (tar) archive and
subarchive data.tar.gz have time set to 1.1.1970.
Why not just clone/fork it from GitHub, apply your patch and commit it,
then use bundler to install the gem using the :git => syntax?
gem ‘gosu’, :git => ‘git://github.com/yourname/gosu.git’ , or
gem ‘gosu’, :git => ‘/myproject/src/gosu.git’ (if it’s on your hard
drive)
I’m a bit for a Ruby noob but have modified gems this way myself several
times, very easy. Gosu has native code in C++ so not sure if that
affects
it. If the above syntax fails, you can try running the Rakefile included
in
the source to build the gem package locally.
Ok, I can use the git sources and maybe install the libs with rake, but
still curious how to modify & rebuild the gem. I thought it has to be a
simple task.
On Sep 7, 2012, at 10:21 AM, Bartosz Dziewoński [email protected] wrote:
Also, .gem files are just ZIP archives, you can unpack them with any
archiver and modify the contents.
.gem files are tar files which contain (at least) a gzipped YAML file
(metadata.gz, the gem spec) and a data.tar.gz (A gzipped tar file). Tools that
only handle zip will not unpack them.