diff --git a/pkgs/development/libraries/irrlicht/common.nix b/pkgs/development/libraries/irrlicht/common.nix new file mode 100644 index 000000000000..f330c30fda11 --- /dev/null +++ b/pkgs/development/libraries/irrlicht/common.nix @@ -0,0 +1,11 @@ +{ fetchzip }: + +rec { + pname = "irrlicht"; + version = "1.8.4"; + + src = fetchzip { + url = "mirror://sourceforge/irrlicht/${pname}-${version}.zip"; + sha256 = "02sq067fn4xpf0lcyb4vqxmm43qg2nxx770bgrl799yymqbvih5f"; + }; +} diff --git a/pkgs/development/libraries/irrlicht/default.nix b/pkgs/development/libraries/irrlicht/default.nix index 65b3ce028afe..f411ecdeea65 100644 --- a/pkgs/development/libraries/irrlicht/default.nix +++ b/pkgs/development/libraries/irrlicht/default.nix @@ -1,14 +1,14 @@ { stdenv, fetchzip, libGLU, libGL, unzip, libXrandr, libX11, libXxf86vm }: +let + common = import ./common.nix { inherit fetchzip; }; +in stdenv.mkDerivation rec { - pname = "irrlicht"; - version = "1.8.4"; + pname = common.pname; + version = common.version; - src = fetchzip { - url = "mirror://sourceforge/irrlicht/${pname}-${version}.zip"; - sha256 = "02sq067fn4xpf0lcyb4vqxmm43qg2nxx770bgrl799yymqbvih5f"; - }; + src = common.src; preConfigure = '' cd source/Irrlicht diff --git a/pkgs/development/libraries/irrlicht/mac.nix b/pkgs/development/libraries/irrlicht/mac.nix index 00300d87582d..beead1f9b857 100644 --- a/pkgs/development/libraries/irrlicht/mac.nix +++ b/pkgs/development/libraries/irrlicht/mac.nix @@ -1,19 +1,12 @@ { stdenv, fetchzip, libGLU, libGL, unzip, fetchFromGitHub, cmake, Cocoa, OpenGL, IOKit }: let - version = "1.8.4"; - - irrlichtZip = fetchzip { - name = "irrlichtZip"; - url = "mirror://sourceforge/irrlicht/irrlicht-${version}.zip"; - sha256 = "02sq067fn4xpf0lcyb4vqxmm43qg2nxx770bgrl799yymqbvih5f"; - }; - + common = import ./common.nix { inherit fetchzip; }; in stdenv.mkDerivation rec { pname = "irrlicht-mac"; - inherit version; + version = common.version; src = fetchFromGitHub { owner = "quiark"; @@ -23,7 +16,7 @@ stdenv.mkDerivation rec { }; postUnpack = '' - cp -r ${irrlichtZip}/* $sourceRoot/ + cp -r ${common.src}/* $sourceRoot/ chmod -R 777 $sourceRoot ''; diff --git a/pkgs/development/libraries/leveldb/default.nix b/pkgs/development/libraries/leveldb/default.nix index 49487fc1e5f8..62abc1bd68ca 100644 --- a/pkgs/development/libraries/leveldb/default.nix +++ b/pkgs/development/libraries/leveldb/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub }: +{ stdenv, fetchFromGitHub, fixDarwinDylibNames }: stdenv.mkDerivation rec { pname = "leveldb"; @@ -11,16 +11,14 @@ stdenv.mkDerivation rec { sha256 = "01kxga1hv4wp94agx5vl3ybxfw5klqrdsrb6p6ywvnjmjxm8322y"; }; + nativeBuildInputs = [] + ++ stdenv.lib.optional stdenv.isDarwin [ fixDarwinDylibNames ]; + buildPhase = '' make all ''; - installPhase = (stdenv.lib.optionalString stdenv.isDarwin '' - for file in out-shared/*.dylib.*.*; do - install_name_tool -id $out/lib/$(basename $file) $file - done - '') + # XXX consider removing above after transition to cmake in the next release - " + installPhase = " mkdir -p $out/{bin,lib,include} cp -r include $out diff --git a/pkgs/games/minetest/default.nix b/pkgs/games/minetest/default.nix index 77a88a2319f2..03c1cb5cc4ab 100644 --- a/pkgs/games/minetest/default.nix +++ b/pkgs/games/minetest/default.nix @@ -40,8 +40,6 @@ let "-DOpenGL_GL_PREFERENCE=GLVND" ]; - patches = [ ./fix_wordsize_confusion.patch ]; - NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg"; # needed since luajit-2.1.0-beta3 nativeBuildInputs = [ cmake doxygen graphviz ];