summary refs log tree commit diff
path: root/pkgs/development/libraries/libui
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2018-11-07 20:01:58 +0100
committerDaiderd Jordan <daiderd@gmail.com>2018-11-07 23:47:24 +0100
commit0b45d5b8f9091ea599ed3a961e275c34a5533b07 (patch)
treecd1ce92f1f6fce0f1a66e46aae34a1d429d80f02 /pkgs/development/libraries/libui
parentbe9fc0d669641c7e3747c37b8419beb93fa5bc0e (diff)
downloadnixpkgs-0b45d5b8f9091ea599ed3a961e275c34a5533b07.tar
nixpkgs-0b45d5b8f9091ea599ed3a961e275c34a5533b07.tar.gz
nixpkgs-0b45d5b8f9091ea599ed3a961e275c34a5533b07.tar.bz2
nixpkgs-0b45d5b8f9091ea599ed3a961e275c34a5533b07.tar.lz
nixpkgs-0b45d5b8f9091ea599ed3a961e275c34a5533b07.tar.xz
nixpkgs-0b45d5b8f9091ea599ed3a961e275c34a5533b07.tar.zst
nixpkgs-0b45d5b8f9091ea599ed3a961e275c34a5533b07.zip
libui: add cf-private on darwin
    Undefined symbols for architecture x86_64:
      "_NSDefaultRunLoopMode", referenced from:
          _uiMainStep in main.m.o
      "_OBJC_CLASS_$_NSDate", referenced from:
          objc-class-ref in main.m.o
      "_OBJC_CLASS_$_NSDictionary", referenced from:
          objc-class-ref in multilineentry.m.o
      "_OBJC_CLASS_$_NSMutableArray", referenced from:
          objc-class-ref in alloc.m.o
          objc-class-ref in box.m.o
          objc-class-ref in menu.m.o
          objc-class-ref in radiobuttons.m.o
          objc-class-ref in tab.m.o
    ld: symbol(s) not found for architecture x86_64
Diffstat (limited to 'pkgs/development/libraries/libui')
-rw-r--r--pkgs/development/libraries/libui/default.nix85
1 files changed, 42 insertions, 43 deletions
diff --git a/pkgs/development/libraries/libui/default.nix b/pkgs/development/libraries/libui/default.nix
index 150e299ac42..dcc406accbd 100644
--- a/pkgs/development/libraries/libui/default.nix
+++ b/pkgs/development/libraries/libui/default.nix
@@ -1,54 +1,53 @@
-{ stdenv, fetchgit, cmake, pkgconfig, gtk3, darwin }:
+{ stdenv, fetchgit, cmake, pkgconfig, gtk3, cf-private, Cocoa }:
 
 let
   shortName = "libui";
   version   = "3.1a";
   backend   = if stdenv.isDarwin then "darwin" else "unix";
 in
-  stdenv.mkDerivation rec {
-    name = "${shortName}-${version}";
-    src  = fetchgit {
-      url    = "https://github.com/andlabs/libui.git";
-      rev    = "6ebdc96b93273c3cedf81159e7843025caa83058";
-      sha256 = "1lpbfa298c61aarlzgp7vghrmxg1274pzxh1j9isv8x758gk6mfn";
-    };
 
-    nativeBuildInputs = [ pkgconfig ];
-    buildInputs = [ cmake ] ++
-      (if backend == "darwin" then [darwin.apple_sdk.frameworks.Cocoa]
-       else if backend == "unix" then [gtk3]
-       else null);
+stdenv.mkDerivation rec {
+  name = "${shortName}-${version}";
+  src  = fetchgit {
+    url    = "https://github.com/andlabs/libui.git";
+    rev    = "6ebdc96b93273c3cedf81159e7843025caa83058";
+    sha256 = "1lpbfa298c61aarlzgp7vghrmxg1274pzxh1j9isv8x758gk6mfn";
+  };
 
-    preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
-      sed -i 's/set(CMAKE_OSX_DEPLOYMENT_TARGET "10.8")//' ./CMakeLists.txt
-    '';
+  nativeBuildInputs = [ cmake pkgconfig ];
+  buildInputs = stdenv.lib.optional stdenv.isLinux gtk3
+    ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa cf-private /* For NSDefaultRunLoopMode */ ];
 
-    installPhase = ''
-      mkdir -p $out/{include,lib}
-      mkdir -p $out/lib/pkgconfig
-    '' + stdenv.lib.optionalString stdenv.isLinux ''
-      mv ./out/${shortName}.so.0 $out/lib/
-      ln -s $out/lib/${shortName}.so.0 $out/lib/${shortName}.so
-    '' + stdenv.lib.optionalString stdenv.isDarwin ''
-      mv ./out/${shortName}.A.dylib $out/lib/
-      ln -s $out/lib/${shortName}.A.dylib $out/lib/${shortName}.dylib
-    '' + ''
-      cp $src/ui.h $out/include
-      cp $src/ui_${backend}.h $out/include
+  preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
+    sed -i 's/set(CMAKE_OSX_DEPLOYMENT_TARGET "10.8")//' ./CMakeLists.txt
+  '';
 
-      cp ${./libui.pc} $out/lib/pkgconfig/${shortName}.pc
-      substituteInPlace $out/lib/pkgconfig/${shortName}.pc \
-        --subst-var-by out $out \
-        --subst-var-by version "${version}"
-    '';
-    postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
-      install_name_tool -id $out/lib/${shortName}.A.dylib $out/lib/${shortName}.A.dylib
-    '';
+  installPhase = ''
+    mkdir -p $out/{include,lib}
+    mkdir -p $out/lib/pkgconfig
+  '' + stdenv.lib.optionalString stdenv.isLinux ''
+    mv ./out/${shortName}.so.0 $out/lib/
+    ln -s $out/lib/${shortName}.so.0 $out/lib/${shortName}.so
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    mv ./out/${shortName}.A.dylib $out/lib/
+    ln -s $out/lib/${shortName}.A.dylib $out/lib/${shortName}.dylib
+  '' + ''
+    cp $src/ui.h $out/include
+    cp $src/ui_${backend}.h $out/include
 
-    meta = with stdenv.lib; {
-      homepage    = https://github.com/andlabs/libui;
-      description = "Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports.";
-      license     = licenses.mit;
-      platforms   = platforms.unix;
-    };
-  }
+    cp ${./libui.pc} $out/lib/pkgconfig/${shortName}.pc
+    substituteInPlace $out/lib/pkgconfig/${shortName}.pc \
+      --subst-var-by out $out \
+      --subst-var-by version "${version}"
+  '';
+  postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
+    install_name_tool -id $out/lib/${shortName}.A.dylib $out/lib/${shortName}.A.dylib
+  '';
+
+  meta = with stdenv.lib; {
+    homepage    = https://github.com/andlabs/libui;
+    description = "Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports.";
+    license     = licenses.mit;
+    platforms   = platforms.unix;
+  };
+}