Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

freeorion: fix build #36659

Merged
merged 1 commit into from Mar 13, 2018
Merged

freeorion: fix build #36659

merged 1 commit into from Mar 13, 2018

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented Mar 9, 2018

Motivation for this change

boost::system::posix_error is deprecated since v1.37, however the
default Boost version in NixOS is 1.66.
(see freeorion/freeorion@c9b5b13)

The issue has been fixed on master, but isn't backported yet, so it
should be sufficient to manually include the patch in our build.

See ticket #36453

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@Ma27
Copy link
Member Author

Ma27 commented Mar 9, 2018

currently WIP as I'm still building locally :)

@Ma27 Ma27 changed the title WIP freeorion: fix build freeorion: fix build Mar 9, 2018
@Ma27
Copy link
Member Author

Ma27 commented Mar 9, 2018

ok, the upstream patch didn't apply properly (and caused build failures), so I patched the stuff manually for the stable version (the fix is in upstream only available for unstable-master)

@pbogdan
Copy link
Member

pbogdan commented Mar 9, 2018

Out of curiosity which patch did you try? I was about to submit a PR for this package when I saw yours so didn't bother in the end but had it working locally by fetching from upstream's GitHub. Here's my diff FWIW:

diff --git a/pkgs/games/freeorion/default.nix b/pkgs/games/freeorion/default.nix
index 3d7e132e612..feef4c9ad11 100644
--- a/pkgs/games/freeorion/default.nix
+++ b/pkgs/games/freeorion/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, doxygen, graphviz, makeWrapper
+{ stdenv, fetchFromGitHub, fetchpatch, cmake, doxygen, graphviz, makeWrapper
 , boost, SDL2, python2, freetype, openal, libogg, libvorbis, zlib, libpng, libtiff, libjpeg, libGLU_combined, glew, libxslt }:
 
 stdenv.mkDerivation rec {
@@ -20,6 +20,11 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./fix_rpaths.patch
+    # fix build with boost 1.66
+    (fetchpatch {
+      url = https://github.com/freeorion/freeorion/commit/c9b5b13fb81b1ed142dee0e843101c6b8832ca95.patch;
+      sha256 = "0agqhxk8462sgd230lmdzbrbrfd77zyy7a4g8hrf28zxza1nza94";
+    })
   ];
 
   postInstall = ''

@fpletz
Copy link
Member

fpletz commented Mar 12, 2018

Fetching the patch from Github if it applies is more preferable.

`boost::system::posix_error` is deprecated since v1.37, however the
default Boost version in NixOS is 1.66.

The following upstream patch fixed the issue:
freeorion/freeorion@c9b5b13

See ticket NixOS#36453
@Ma27
Copy link
Member Author

Ma27 commented Mar 13, 2018

@fpletz @pbogdan thanks, done %)

@pbogdan
Copy link
Member

pbogdan commented Mar 13, 2018

@GrahamcOfBorg build freeorion

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: freeorion

Partial log (click to expand)

shrinking /nix/store/awi0fsryc12sm2n80csph3rrsdmh40jd-freeorion-0.4.7.1/bin/freeorionca
shrinking /nix/store/awi0fsryc12sm2n80csph3rrsdmh40jd-freeorion-0.4.7.1/lib/freeorion/libGiGiSDL.so
shrinking /nix/store/awi0fsryc12sm2n80csph3rrsdmh40jd-freeorion-0.4.7.1/lib/freeorion/libfreeorioncommon.so
shrinking /nix/store/awi0fsryc12sm2n80csph3rrsdmh40jd-freeorion-0.4.7.1/lib/freeorion/libGiGi.so
shrinking /nix/store/awi0fsryc12sm2n80csph3rrsdmh40jd-freeorion-0.4.7.1/lib/freeorion/libfreeorionparse.so
strip is /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/awi0fsryc12sm2n80csph3rrsdmh40jd-freeorion-0.4.7.1/lib  /nix/store/awi0fsryc12sm2n80csph3rrsdmh40jd-freeorion-0.4.7.1/bin 
patching script interpreter paths in /nix/store/awi0fsryc12sm2n80csph3rrsdmh40jd-freeorion-0.4.7.1
/nix/store/awi0fsryc12sm2n80csph3rrsdmh40jd-freeorion-0.4.7.1/fixpaths/fix-paths: interpreter directive changed from "/bin/sh" to "/nix/store/zqh3l3lyw32q1ayb15bnvg9f24j5v2p0-bash-4.4-p12/bin/sh"
checking for references to /tmp/nix-build-freeorion-0.4.7.1.drv-0 in /nix/store/awi0fsryc12sm2n80csph3rrsdmh40jd-freeorion-0.4.7.1...

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: freeorion

Partial log (click to expand)

shrinking /nix/store/22pg1vhjxnjrk5yv1abskl8xc481rsg7-freeorion-0.4.7.1/lib/freeorion/libGiGiSDL.so
shrinking /nix/store/22pg1vhjxnjrk5yv1abskl8xc481rsg7-freeorion-0.4.7.1/lib/freeorion/libGiGi.so
shrinking /nix/store/22pg1vhjxnjrk5yv1abskl8xc481rsg7-freeorion-0.4.7.1/lib/freeorion/libfreeorionparse.so
shrinking /nix/store/22pg1vhjxnjrk5yv1abskl8xc481rsg7-freeorion-0.4.7.1/lib/freeorion/libfreeorioncommon.so
strip is /nix/store/lvx1acn1ig1j2km8jds5x3ggh3f2wa8v-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/22pg1vhjxnjrk5yv1abskl8xc481rsg7-freeorion-0.4.7.1/lib  /nix/store/22pg1vhjxnjrk5yv1abskl8xc481rsg7-freeorion-0.4.7.1/bin
patching script interpreter paths in /nix/store/22pg1vhjxnjrk5yv1abskl8xc481rsg7-freeorion-0.4.7.1
/nix/store/22pg1vhjxnjrk5yv1abskl8xc481rsg7-freeorion-0.4.7.1/fixpaths/fix-paths: interpreter directive changed from "/bin/sh" to "/nix/store/lnws52qanbi5vz8qg24v4ym57nznfndg-bash-4.4-p12/bin/sh"
checking for references to /build in /nix/store/22pg1vhjxnjrk5yv1abskl8xc481rsg7-freeorion-0.4.7.1...
/nix/store/22pg1vhjxnjrk5yv1abskl8xc481rsg7-freeorion-0.4.7.1

@fpletz fpletz merged commit 134af4c into NixOS:master Mar 13, 2018
@Ma27 Ma27 deleted the fix-freeorion branch March 21, 2018 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants