From 5eb75ce205ac00b1a2403425b6b195627da0f699 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 9 Apr 2017 04:22:08 -0500 Subject: [PATCH 01/15] xcbuild: add app bundle specs --- pkgs/development/tools/xcbuild/platform.nix | 94 +++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/pkgs/development/tools/xcbuild/platform.nix b/pkgs/development/tools/xcbuild/platform.nix index 34fc5b0f620..a1f4eed8e60 100644 --- a/pkgs/development/tools/xcbuild/platform.nix +++ b/pkgs/development/tools/xcbuild/platform.nix @@ -101,6 +101,54 @@ let Name = "$(EXECUTABLE_NAME)"; }; } + { + Identifier = "com.apple.package-type.wrapper"; + Type = "PackageType"; + Name = "Wrapper"; + DefaultBuildSettings = { + WRAPPER_SUFFIX = ".bundle"; + WRAPPER_NAME = "$(WRAPPER_PREFIX)$(PRODUCT_NAME)$(WRAPPER_SUFFIX)"; + CONTENTS_FOLDER_PATH = "$(WRAPPER_NAME)/Contents"; + EXECUTABLE_NAME = "$(EXECUTABLE_PREFIX)$(PRODUCT_NAME)$(EXECUTABLE_VARIANT_SUFFIX)$(EXECUTABLE_SUFFIX)"; + EXECUTABLE_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/MacOS"; + EXECUTABLE_PATH = "$(EXECUTABLE_FOLDER_PATH)/$(EXECUTABLE_NAME)"; + INFOPLIST_PATH = "$(CONTENTS_FOLDER_PATH)/Info.plist"; + INFOSTRINGS_PATH = "$(LOCALIZED_RESOURCES_FOLDER_PATH)/InfoPlist.strings"; + PKGINFO_PATH = "$(CONTENTS_FOLDER_PATH)/PkgInfo"; + PBDEVELOPMENTPLIST_PATH = "$(CONTENTS_FOLDER_PATH)/pbdevelopment.plist"; + VERSIONPLIST_PATH = "$(CONTENTS_FOLDER_PATH)/version.plist"; + PUBLIC_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Headers"; + PRIVATE_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/PrivateHeaders"; + EXECUTABLES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Executables"; + FRAMEWORKS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Frameworks"; + SHARED_FRAMEWORKS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/SharedFrameworks"; + SHARED_SUPPORT_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/SharedSupport"; + UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Resources"; + LOCALIZED_RESOURCES_FOLDER_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/$(DEVELOPMENT_LANGUAGE).lproj"; + DOCUMENTATION_FOLDER_PATH = "$(LOCALIZED_RESOURCES_FOLDER_PATH)/Documentation"; + PLUGINS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/PlugIns"; + SCRIPTS_FOLDER_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Scripts"; + }; + ProductReference = { + FileType = "wrapper.cfbundle"; + Name = "$(WRAPPER_NAME)"; + IsLaunchable = "NO"; + }; + } + { + Identifier = "com.apple.package-type.wrapper.application"; + Type = "PackageType"; + BasedOn = "com.apple.package-type.wrapper"; + Name = "Application Wrapper"; + DefaultBuildSettings = { + GENERATE_PKGINFO_FILE = "YES"; + }; + ProductReference = { + FileType = "wrapper.application"; + Name = "$(WRAPPER_NAME)"; + IsLaunchable = "YES"; + }; + } ]; # Based off of the MacOSX Product Types.xcpsec file. All @@ -125,6 +173,52 @@ let Name = "Dynamic Library"; PackageTypes = [ "com.apple.package-type.mach-o-dylib" ]; } + { + Type = "ProductType"; + Identifier = "com.apple.product-type.bundle"; + Name = "Bundle"; + DefaultTargetName = "Bundle"; + DefaultBuildProperties = { + FULL_PRODUCT_NAME = "$(WRAPPER_NAME)"; + MACH_O_TYPE = "mh_bundle"; + WRAPPER_PREFIX = ""; + WRAPPER_SUFFIX = ".$(WRAPPER_EXTENSION)"; + WRAPPER_EXTENSION = "bundle"; + WRAPPER_NAME = "$(WRAPPER_PREFIX)$(PRODUCT_NAME)$(WRAPPER_SUFFIX)"; + FRAMEWORK_FLAG_PREFIX = "-framework"; + LIBRARY_FLAG_PREFIX = "-l"; + LIBRARY_FLAG_NOSPACE = "YES"; + STRIP_STYLE = "non-global"; + GCC_INLINES_ARE_PRIVATE_EXTERN = "YES"; + }; + PackageTypes = [ "com.apple.package-type.wrapper" ]; + IsWrapper = "YES"; + HasInfoPlist = "YES"; + HasInfoPlistStrings = "YES"; + } + { + Identifier = "com.apple.product-type.application"; + Type = "ProductType"; + BasedOn = "com.apple.product-type.bundle"; + Name = "Application"; + DefaultTargetName = "Application"; + DefaultBuildProperties = { + MACH_O_TYPE = "mh_execute"; + GCC_DYNAMIC_NO_PIC = "NO"; + GCC_SYMBOLS_PRIVATE_EXTERN = "YES"; + GCC_INLINES_ARE_PRIVATE_EXTERN = "YES"; + WRAPPER_SUFFIX = ".$(WRAPPER_EXTENSION)"; + WRAPPER_EXTENSION = "app"; + INSTALL_PATH = "$(LOCAL_APPS_DIR)"; + STRIP_STYLE = "all"; + }; + PackageTypes = [ "com.apple.package-type.wrapper.application" ]; + CanEmbedCompilerSanitizerLibraries = "YES"; + RunpathSearchPathForEmbeddedFrameworks = "@executable_path/../Frameworks"; + ValidateEmbeddedBinaries = "YES"; + ProvisioningProfileSupported = "YES"; + ProvisioningProfileRequired = "NO"; + } ]; in From a78af29ae7e7d2d0c0737271cfdb0ff710493e1d Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 9 Apr 2017 04:22:44 -0500 Subject: [PATCH 02/15] install_name_tool: remove cctools provides install_name_tool --- .../darwin/install_name_tool/default.nix | 29 ------------------- pkgs/top-level/all-packages.nix | 2 -- pkgs/top-level/python-packages.nix | 3 +- 3 files changed, 1 insertion(+), 33 deletions(-) delete mode 100644 pkgs/os-specific/darwin/install_name_tool/default.nix diff --git a/pkgs/os-specific/darwin/install_name_tool/default.nix b/pkgs/os-specific/darwin/install_name_tool/default.nix deleted file mode 100644 index 581eb31cc71..00000000000 --- a/pkgs/os-specific/darwin/install_name_tool/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ stdenv }: - -assert stdenv.isDarwin; - -stdenv.mkDerivation { - name = "install_name_tool"; - src = "/usr/bin/install_name_tool"; - - unpackPhase = "true"; - dontBuild = true; - - installPhase = '' - mkdir -p "$out"/bin - ln -s "$src" "$out"/bin - ''; - - meta = with stdenv.lib; { - description = "Change dynamic shared library install names"; - homepage = https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man1/install_name_tool.1.html; - maintainers = with maintainers; [ lovek323 ]; - platforms = platforms.darwin; - - longDescription = '' - Install_name_tool changes the dynamic shared library install names and or - adds, changes or deletes the rpaths recorded in a Mach-O binary. - ''; - }; -} - diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e0ef39ce64f..ca033e4ffdc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -547,8 +547,6 @@ with pkgs; reattach-to-user-namespace = callPackage ../os-specific/darwin/reattach-to-user-namespace {}; - install_name_tool = callPackage ../os-specific/darwin/install_name_tool { }; - xcodeenv = callPackage ../development/mobile/xcodeenv { }; titaniumenv = callPackage ../development/mobile/titaniumenv { diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8fd95ea65d7..266f11a73ff 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -28918,8 +28918,7 @@ EOF }; propagatedBuildInputs = with self; [ cffi ]; - buildInputs = [ pkgs.libspotify ] - ++ stdenv.lib.optional stdenv.isDarwin pkgs.install_name_tool; + buildInputs = [ pkgs.libspotify ]; # python zip complains about old timestamps preConfigure = '' From 38fa9910642bc819484726aec596f4827b10ba2f Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 9 Apr 2017 04:24:16 -0500 Subject: [PATCH 03/15] pinentry_mac: use xcbuild --- pkgs/tools/security/pinentry-mac/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/security/pinentry-mac/default.nix b/pkgs/tools/security/pinentry-mac/default.nix index 7116d1777d6..ba3e8b1818d 100644 --- a/pkgs/tools/security/pinentry-mac/default.nix +++ b/pkgs/tools/security/pinentry-mac/default.nix @@ -1,4 +1,4 @@ -{ fetchurl, stdenv }: +{ fetchurl, stdenv, xcbuild }: stdenv.mkDerivation rec { name = "pinentry-mac-0.9.4"; @@ -8,9 +8,9 @@ stdenv.mkDerivation rec { sha256 = "037ebb010377d3a3879ae2a832cefc4513f5c397d7d887d7b86b4e5d9a628271"; }; - postPatch = '' - substituteInPlace ./Makefile --replace "xcodebuild" "/usr/bin/xcodebuild" - ''; + buildInputs = [ xcbuild ]; + + dontUseXcbuild = true; installPhase = '' mkdir -p $out/Applications From 34422f428d583f57b3cbdaf6bbcc1e0ca61662c4 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 9 Apr 2017 04:27:21 -0500 Subject: [PATCH 04/15] ibtool: add to toolchain - init package - add into xcbuild/toolchain.nix --- pkgs/development/tools/xcbuild/toolchain.nix | 5 ++++- pkgs/os-specific/darwin/ibtool/default.nix | 20 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 pkgs/os-specific/darwin/ibtool/default.nix diff --git a/pkgs/development/tools/xcbuild/toolchain.nix b/pkgs/development/tools/xcbuild/toolchain.nix index 4313f005147..cdf4a673cc5 100644 --- a/pkgs/development/tools/xcbuild/toolchain.nix +++ b/pkgs/development/tools/xcbuild/toolchain.nix @@ -1,6 +1,7 @@ {stdenv, writeText, toolchainName, xcbuild, fetchurl , llvm, cctools, gcc, bootstrap_cmds, binutils -, yacc, flex, m4, unifdef, gperf, indent, ctags, makeWrapper}: +, yacc, flex, m4, unifdef, gperf, indent, ctags, makeWrapper +, ibtool}: let @@ -89,6 +90,8 @@ stdenv.mkDerivation { ln -s ${cctools}/bin/pagestuff ln -s ${cctools}/bin/ranlib ln -s ${cctools}/bin/redo_prebinding + + ln -s ${ibtool}/bin/ibtool '' + # No point including the entire gcc closure if we don't already have it (if stdenv.cc.isClang then '' diff --git a/pkgs/os-specific/darwin/ibtool/default.nix b/pkgs/os-specific/darwin/ibtool/default.nix new file mode 100644 index 00000000000..556426ac62d --- /dev/null +++ b/pkgs/os-specific/darwin/ibtool/default.nix @@ -0,0 +1,20 @@ +{ stdenv }: + +assert stdenv.isDarwin; + +stdenv.mkDerivation { + name = "ibtool"; + src = "/usr/bin/ibtool"; + + unpackPhase = "true"; + dontBuild = true; + + installPhase = '' + mkdir -p "$out"/bin + ln -s "$src" "$out"/bin + ''; + + meta = with stdenv.lib; { + platforms = platforms.darwin; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ca033e4ffdc..30f6598f975 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18407,4 +18407,6 @@ with pkgs; ghc-standalone-archive = callPackage ../os-specific/darwin/ghc-standalone-archive { inherit (darwin) cctools; }; messenger-for-desktop = callPackage ../applications/networking/instant-messengers/messenger-for-desktop {}; + + ibtool = callPackage ../os-specific/darwin/ibtool {}; } From 87e6b2c50fb4520d9ef910418f3c686d830dc3df Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 9 Apr 2017 04:27:56 -0500 Subject: [PATCH 05/15] xcbuild: try to fix sdk not found This is an attempt to get rid of the issues with sdk not found in xcbuild when building pinentry_mac. --- pkgs/development/tools/xcbuild/platform.nix | 2 +- pkgs/development/tools/xcbuild/wrapper.nix | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/xcbuild/platform.nix b/pkgs/development/tools/xcbuild/platform.nix index a1f4eed8e60..01693ce8e5b 100644 --- a/pkgs/development/tools/xcbuild/platform.nix +++ b/pkgs/development/tools/xcbuild/platform.nix @@ -241,6 +241,6 @@ stdenv.mkDerivation { mkdir -p $out/Developer/SDKs/ cd $out/Developer/SDKs/ - ln -s ${sdk} + ln -s ${sdk} macosx10.10.sdk ''; } diff --git a/pkgs/development/tools/xcbuild/wrapper.nix b/pkgs/development/tools/xcbuild/wrapper.nix index ab6605e91b1..3dfc7f36343 100644 --- a/pkgs/development/tools/xcbuild/wrapper.nix +++ b/pkgs/development/tools/xcbuild/wrapper.nix @@ -60,9 +60,13 @@ stdenv.mkDerivation { --add-flags "DERIVED_DATA_DIR=." \ --set DEVELOPER_DIR "$out" wrapProgram $out/bin/xcrun \ + --add-flags "-sdk macosx10.10" \ --set DEVELOPER_DIR "$out" wrapProgram $out/bin/xcode-select \ --set DEVELOPER_DIR "$out" + + mkdir -p $out/usr/bin/ + ln -s $out/bin/xcrun $out/usr/bin/xcrun ''; inherit (xcbuild) meta; From f1fdc988844926f90c855f55b66955d61034569a Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 11 Apr 2017 01:03:11 -0500 Subject: [PATCH 06/15] pugixml: fixup darwin --- .../development/libraries/pugixml/default.nix | 3 --- .../libraries/pugixml/no-long-long.patch | 19 ------------------- 2 files changed, 22 deletions(-) delete mode 100644 pkgs/development/libraries/pugixml/no-long-long.patch diff --git a/pkgs/development/libraries/pugixml/default.nix b/pkgs/development/libraries/pugixml/default.nix index 8c40ff2be20..d9d0afa2bde 100644 --- a/pkgs/development/libraries/pugixml/default.nix +++ b/pkgs/development/libraries/pugixml/default.nix @@ -18,9 +18,6 @@ stdenv.mkDerivation rec { sed -ire '/PUGIXML_HAS_LONG_LONG/ s/^\/\///' src/pugiconfig.hpp ''; - patches = [] - ++ stdenv.lib.optionals stdenv.isDarwin [ ./no-long-long.patch ]; - meta = with stdenv.lib; { description = "Light-weight, simple and fast XML parser for C++ with XPath support"; homepage = http://pugixml.org/; diff --git a/pkgs/development/libraries/pugixml/no-long-long.patch b/pkgs/development/libraries/pugixml/no-long-long.patch deleted file mode 100644 index 46c54e85a1d..00000000000 --- a/pkgs/development/libraries/pugixml/no-long-long.patch +++ /dev/null @@ -1,19 +0,0 @@ -Get rid of long-long feature. This breaks on AppleClang compilers. ---- -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 40a7ab0..c84f0f7 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -26,9 +26,9 @@ else() - endif() - - # Enable C++11 long long for compilers that are capable of it --if(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} STRLESS 3.1) -- target_compile_features(pugixml PUBLIC cxx_long_long_type) --endif() -+# if(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} STRLESS 3.1) -+# target_compile_features(pugixml PUBLIC cxx_long_long_type) -+# endif() - - set_target_properties(pugixml PROPERTIES VERSION 1.7 SOVERSION 1) - From bb2eb5b0e8d18424e87918819c9291f3b697e92f Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 11 Apr 2017 03:22:32 -0500 Subject: [PATCH 07/15] ibtool: use xib2nib src --- pkgs/development/tools/ibtool/default.nix | 22 +++++++++++++++++++++ pkgs/development/tools/ibtool/nsplist.nix | 14 +++++++++++++ pkgs/development/tools/ibtool/plist-cpp.nix | 14 +++++++++++++ pkgs/os-specific/darwin/ibtool/default.nix | 20 ------------------- pkgs/top-level/all-packages.nix | 2 +- 5 files changed, 51 insertions(+), 21 deletions(-) create mode 100644 pkgs/development/tools/ibtool/default.nix create mode 100644 pkgs/development/tools/ibtool/nsplist.nix create mode 100644 pkgs/development/tools/ibtool/plist-cpp.nix delete mode 100644 pkgs/os-specific/darwin/ibtool/default.nix diff --git a/pkgs/development/tools/ibtool/default.nix b/pkgs/development/tools/ibtool/default.nix new file mode 100644 index 00000000000..17b9a77a7a1 --- /dev/null +++ b/pkgs/development/tools/ibtool/default.nix @@ -0,0 +1,22 @@ +{ stdenv, callPackage, fetchFromGitHub, pugixml, boost }: + +let + + NSPlist = callPackage ./nsplist.nix { }; + PlistCpp = callPackage ./plist-cpp.nix { inherit NSPlist; }; + +in + +stdenv.mkDerivation { + name = "xib2nib-730e177"; + + src = fetchFromGitHub { + owner = "matthewbauer"; + repo = "xib2nib"; + rev = "636fe783e8625bbdd7bfeaf85470ba3eb7b90359"; + sha256 = "08fhx8rww95h1fpl1cwhd82bcqv1k51k542v4kawjf8w814g5y1c"; + }; + + buildInputs = [ PlistCpp pugixml boost ]; + makeFlags = [ "PREFIX=$(out)" ]; +} diff --git a/pkgs/development/tools/ibtool/nsplist.nix b/pkgs/development/tools/ibtool/nsplist.nix new file mode 100644 index 00000000000..557cb5b3bd5 --- /dev/null +++ b/pkgs/development/tools/ibtool/nsplist.nix @@ -0,0 +1,14 @@ +{ stdenv, fetchFromGitHub, cmake }: + +stdenv.mkDerivation { + name = "nsplist-713decf"; + + src = fetchFromGitHub { + owner = "matthewbauer"; + repo = "NSPlist"; + rev = "713decf06c1ef6c39a707bc99eb45ac9925f2b8a"; + sha256 = "0v4yfiwfd08hmh2ydgy6pnmlzjbd96k78dsla9pfd56ka89aw74r"; + }; + + buildInputs = [ cmake ]; +} diff --git a/pkgs/development/tools/ibtool/plist-cpp.nix b/pkgs/development/tools/ibtool/plist-cpp.nix new file mode 100644 index 00000000000..3e15489898d --- /dev/null +++ b/pkgs/development/tools/ibtool/plist-cpp.nix @@ -0,0 +1,14 @@ +{ stdenv, fetchFromGitHub, cmake, boost, NSPlist, pugixml }: + +stdenv.mkDerivation { + name = "plistcpp-11615d"; + + src = fetchFromGitHub { + owner = "matthewbauer"; + repo = "PlistCpp"; + rev = "11615deab3369356a182dabbf5bae30574967264"; + sha256 = "10jn6bvm9vn6492zix2pd724v5h4lccmkqg3lxfw8r0qg3av0yzv"; + }; + + buildInputs = [ cmake boost NSPlist pugixml ]; +} diff --git a/pkgs/os-specific/darwin/ibtool/default.nix b/pkgs/os-specific/darwin/ibtool/default.nix deleted file mode 100644 index 556426ac62d..00000000000 --- a/pkgs/os-specific/darwin/ibtool/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ stdenv }: - -assert stdenv.isDarwin; - -stdenv.mkDerivation { - name = "ibtool"; - src = "/usr/bin/ibtool"; - - unpackPhase = "true"; - dontBuild = true; - - installPhase = '' - mkdir -p "$out"/bin - ln -s "$src" "$out"/bin - ''; - - meta = with stdenv.lib; { - platforms = platforms.darwin; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 30f6598f975..9c909a49a97 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18408,5 +18408,5 @@ with pkgs; messenger-for-desktop = callPackage ../applications/networking/instant-messengers/messenger-for-desktop {}; - ibtool = callPackage ../os-specific/darwin/ibtool {}; + ibtool = callPackage ../development/tools/ibtool {}; } From c90058e7748e95f01ceed9544c14fbf753fe77f0 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 12 Apr 2017 02:59:18 -0500 Subject: [PATCH 08/15] ibtool: update to newer hash --- pkgs/development/tools/ibtool/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/ibtool/default.nix b/pkgs/development/tools/ibtool/default.nix index 17b9a77a7a1..bc4bf4bb948 100644 --- a/pkgs/development/tools/ibtool/default.nix +++ b/pkgs/development/tools/ibtool/default.nix @@ -13,8 +13,8 @@ stdenv.mkDerivation { src = fetchFromGitHub { owner = "matthewbauer"; repo = "xib2nib"; - rev = "636fe783e8625bbdd7bfeaf85470ba3eb7b90359"; - sha256 = "08fhx8rww95h1fpl1cwhd82bcqv1k51k542v4kawjf8w814g5y1c"; + rev = "97c6a53aab83d919805efcae33cf80690e953d1e"; + sha256 = "08442f4xg7racknj35nr56a4c62gvdgdw55pssbkn2qq0rfzziqq"; }; buildInputs = [ PlistCpp pugixml boost ]; From 457570f61a2fdad28d56117c0dc7d285a5c06236 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 12 Apr 2017 02:59:54 -0500 Subject: [PATCH 09/15] pinentry_mac: switch to pure version Fixes #24734 --- pkgs/tools/security/pinentry-mac/default.nix | 14 ++++++++------ pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/pkgs/tools/security/pinentry-mac/default.nix b/pkgs/tools/security/pinentry-mac/default.nix index ba3e8b1818d..6aa14ab90e7 100644 --- a/pkgs/tools/security/pinentry-mac/default.nix +++ b/pkgs/tools/security/pinentry-mac/default.nix @@ -1,20 +1,22 @@ -{ fetchurl, stdenv, xcbuild }: +{ fetchurl, stdenv, fetchFromGitHub, xcbuild, libiconv, Cocoa, ncurses }: stdenv.mkDerivation rec { name = "pinentry-mac-0.9.4"; - src = fetchurl { - url = "https://github.com/GPGTools/pinentry-mac/archive/v0.9.4.tar.gz"; - sha256 = "037ebb010377d3a3879ae2a832cefc4513f5c397d7d887d7b86b4e5d9a628271"; + src = fetchFromGitHub { + owner = "matthewbauer"; + repo = "pinentry-mac"; + rev = "77fc993d1040ed2319d9e53af78146be318c1fdd"; + sha256 = "0rkmp6wb8wvmhipavn1bdmbw6564hc2b99dxqysr6yxr2xqs6fcz"; }; - buildInputs = [ xcbuild ]; + buildInputs = [ xcbuild libiconv Cocoa ncurses ]; dontUseXcbuild = true; installPhase = '' mkdir -p $out/Applications - mv build/Release/pinentry-mac.app $out/Applications + mv pinentry-mac-*/Build/Products/Release/pinentry-mac.app $out/Applications ''; passthru = { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9c909a49a97..95b50aa463f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3479,7 +3479,9 @@ with pkgs; libcap = if stdenv.isDarwin then null else libcap; }; - pinentry_mac = callPackage ../tools/security/pinentry-mac { }; + pinentry_mac = callPackage ../tools/security/pinentry-mac { + inherit (darwin.apple_sdk.frameworks) Cocoa; + }; pingtcp = callPackage ../tools/networking/pingtcp { }; From f6860a6685553098bd7c295f0d435ec934ae7cef Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 12 Apr 2017 03:21:58 -0500 Subject: [PATCH 10/15] xcbuild: remove unnecessary flags --- pkgs/development/tools/xcbuild/platform.nix | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/pkgs/development/tools/xcbuild/platform.nix b/pkgs/development/tools/xcbuild/platform.nix index 01693ce8e5b..cacf9467356 100644 --- a/pkgs/development/tools/xcbuild/platform.nix +++ b/pkgs/development/tools/xcbuild/platform.nix @@ -177,7 +177,6 @@ let Type = "ProductType"; Identifier = "com.apple.product-type.bundle"; Name = "Bundle"; - DefaultTargetName = "Bundle"; DefaultBuildProperties = { FULL_PRODUCT_NAME = "$(WRAPPER_NAME)"; MACH_O_TYPE = "mh_bundle"; @@ -189,7 +188,6 @@ let LIBRARY_FLAG_PREFIX = "-l"; LIBRARY_FLAG_NOSPACE = "YES"; STRIP_STYLE = "non-global"; - GCC_INLINES_ARE_PRIVATE_EXTERN = "YES"; }; PackageTypes = [ "com.apple.package-type.wrapper" ]; IsWrapper = "YES"; @@ -201,23 +199,12 @@ let Type = "ProductType"; BasedOn = "com.apple.product-type.bundle"; Name = "Application"; - DefaultTargetName = "Application"; DefaultBuildProperties = { MACH_O_TYPE = "mh_execute"; - GCC_DYNAMIC_NO_PIC = "NO"; - GCC_SYMBOLS_PRIVATE_EXTERN = "YES"; - GCC_INLINES_ARE_PRIVATE_EXTERN = "YES"; WRAPPER_SUFFIX = ".$(WRAPPER_EXTENSION)"; WRAPPER_EXTENSION = "app"; - INSTALL_PATH = "$(LOCAL_APPS_DIR)"; - STRIP_STYLE = "all"; }; PackageTypes = [ "com.apple.package-type.wrapper.application" ]; - CanEmbedCompilerSanitizerLibraries = "YES"; - RunpathSearchPathForEmbeddedFrameworks = "@executable_path/../Frameworks"; - ValidateEmbeddedBinaries = "YES"; - ProvisioningProfileSupported = "YES"; - ProvisioningProfileRequired = "NO"; } ]; From d697e5c8ee16c4a364aedf0d0ecde1fd9e4c9c9e Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 12 Apr 2017 03:23:28 -0500 Subject: [PATCH 11/15] ibtool: rename xib2nib --- pkgs/development/tools/xcbuild/toolchain.nix | 4 ++-- pkgs/development/tools/{ibtool => xib2nib}/default.nix | 0 pkgs/development/tools/{ibtool => xib2nib}/nsplist.nix | 0 pkgs/development/tools/{ibtool => xib2nib}/plist-cpp.nix | 0 pkgs/top-level/all-packages.nix | 2 +- 5 files changed, 3 insertions(+), 3 deletions(-) rename pkgs/development/tools/{ibtool => xib2nib}/default.nix (100%) rename pkgs/development/tools/{ibtool => xib2nib}/nsplist.nix (100%) rename pkgs/development/tools/{ibtool => xib2nib}/plist-cpp.nix (100%) diff --git a/pkgs/development/tools/xcbuild/toolchain.nix b/pkgs/development/tools/xcbuild/toolchain.nix index cdf4a673cc5..9e34360909f 100644 --- a/pkgs/development/tools/xcbuild/toolchain.nix +++ b/pkgs/development/tools/xcbuild/toolchain.nix @@ -1,7 +1,7 @@ {stdenv, writeText, toolchainName, xcbuild, fetchurl , llvm, cctools, gcc, bootstrap_cmds, binutils , yacc, flex, m4, unifdef, gperf, indent, ctags, makeWrapper -, ibtool}: +, xib2nib}: let @@ -91,7 +91,7 @@ stdenv.mkDerivation { ln -s ${cctools}/bin/ranlib ln -s ${cctools}/bin/redo_prebinding - ln -s ${ibtool}/bin/ibtool + ln -s ${xib2nib}/bin/ibtool '' + # No point including the entire gcc closure if we don't already have it (if stdenv.cc.isClang then '' diff --git a/pkgs/development/tools/ibtool/default.nix b/pkgs/development/tools/xib2nib/default.nix similarity index 100% rename from pkgs/development/tools/ibtool/default.nix rename to pkgs/development/tools/xib2nib/default.nix diff --git a/pkgs/development/tools/ibtool/nsplist.nix b/pkgs/development/tools/xib2nib/nsplist.nix similarity index 100% rename from pkgs/development/tools/ibtool/nsplist.nix rename to pkgs/development/tools/xib2nib/nsplist.nix diff --git a/pkgs/development/tools/ibtool/plist-cpp.nix b/pkgs/development/tools/xib2nib/plist-cpp.nix similarity index 100% rename from pkgs/development/tools/ibtool/plist-cpp.nix rename to pkgs/development/tools/xib2nib/plist-cpp.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 95b50aa463f..e7500292dcf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18410,5 +18410,5 @@ with pkgs; messenger-for-desktop = callPackage ../applications/networking/instant-messengers/messenger-for-desktop {}; - ibtool = callPackage ../development/tools/ibtool {}; + xib2nib = callPackage ../development/tools/xib2nib {}; } From 1781ec934f5a815d13b768a77a4bde8798db26d3 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 12 Apr 2017 03:28:33 -0500 Subject: [PATCH 12/15] xib2nib: move nsplist, plistcpp to own folder These libraries could be used by other packages so list them in all-packages.nix as well. --- .../nsplist.nix => libraries/NSPlist/default.nix} | 2 +- .../plist-cpp.nix => libraries/PlistCpp/default.nix} | 2 +- pkgs/development/tools/xib2nib/default.nix | 9 +-------- pkgs/top-level/all-packages.nix | 5 +++++ 4 files changed, 8 insertions(+), 10 deletions(-) rename pkgs/development/{tools/xib2nib/nsplist.nix => libraries/NSPlist/default.nix} (91%) rename pkgs/development/{tools/xib2nib/plist-cpp.nix => libraries/PlistCpp/default.nix} (92%) diff --git a/pkgs/development/tools/xib2nib/nsplist.nix b/pkgs/development/libraries/NSPlist/default.nix similarity index 91% rename from pkgs/development/tools/xib2nib/nsplist.nix rename to pkgs/development/libraries/NSPlist/default.nix index 557cb5b3bd5..c06d98876de 100644 --- a/pkgs/development/tools/xib2nib/nsplist.nix +++ b/pkgs/development/libraries/NSPlist/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchFromGitHub, cmake }: stdenv.mkDerivation { - name = "nsplist-713decf"; + name = "NSPlist-713decf"; src = fetchFromGitHub { owner = "matthewbauer"; diff --git a/pkgs/development/tools/xib2nib/plist-cpp.nix b/pkgs/development/libraries/PlistCpp/default.nix similarity index 92% rename from pkgs/development/tools/xib2nib/plist-cpp.nix rename to pkgs/development/libraries/PlistCpp/default.nix index 3e15489898d..511915be39f 100644 --- a/pkgs/development/tools/xib2nib/plist-cpp.nix +++ b/pkgs/development/libraries/PlistCpp/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchFromGitHub, cmake, boost, NSPlist, pugixml }: stdenv.mkDerivation { - name = "plistcpp-11615d"; + name = "PlistCpp-11615d"; src = fetchFromGitHub { owner = "matthewbauer"; diff --git a/pkgs/development/tools/xib2nib/default.nix b/pkgs/development/tools/xib2nib/default.nix index bc4bf4bb948..5f516ee97cb 100644 --- a/pkgs/development/tools/xib2nib/default.nix +++ b/pkgs/development/tools/xib2nib/default.nix @@ -1,11 +1,4 @@ -{ stdenv, callPackage, fetchFromGitHub, pugixml, boost }: - -let - - NSPlist = callPackage ./nsplist.nix { }; - PlistCpp = callPackage ./plist-cpp.nix { inherit NSPlist; }; - -in +{ stdenv, callPackage, fetchFromGitHub, pugixml, boost, PlistCpp }: stdenv.mkDerivation { name = "xib2nib-730e177"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e7500292dcf..b981dd492d5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18410,5 +18410,10 @@ with pkgs; messenger-for-desktop = callPackage ../applications/networking/instant-messengers/messenger-for-desktop {}; + NSPlist = callPackage ../development/libraries/NSPlist {}; + + PlistCpp = callPackage ../development/libraries/PlistCpp {}; + xib2nib = callPackage ../development/tools/xib2nib {}; + } From 3d1d805245c1b0788e1ce4a01d8455e30ac15739 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 12 Apr 2017 05:20:33 -0500 Subject: [PATCH 13/15] Revert "xcbuild: try to fix sdk not found" This reverts commit 87e6b2c50fb4520d9ef910418f3c686d830dc3df. --- pkgs/development/tools/xcbuild/platform.nix | 2 +- pkgs/development/tools/xcbuild/wrapper.nix | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/pkgs/development/tools/xcbuild/platform.nix b/pkgs/development/tools/xcbuild/platform.nix index cacf9467356..31692d9bee6 100644 --- a/pkgs/development/tools/xcbuild/platform.nix +++ b/pkgs/development/tools/xcbuild/platform.nix @@ -228,6 +228,6 @@ stdenv.mkDerivation { mkdir -p $out/Developer/SDKs/ cd $out/Developer/SDKs/ - ln -s ${sdk} macosx10.10.sdk + ln -s ${sdk} ''; } diff --git a/pkgs/development/tools/xcbuild/wrapper.nix b/pkgs/development/tools/xcbuild/wrapper.nix index 3dfc7f36343..ab6605e91b1 100644 --- a/pkgs/development/tools/xcbuild/wrapper.nix +++ b/pkgs/development/tools/xcbuild/wrapper.nix @@ -60,13 +60,9 @@ stdenv.mkDerivation { --add-flags "DERIVED_DATA_DIR=." \ --set DEVELOPER_DIR "$out" wrapProgram $out/bin/xcrun \ - --add-flags "-sdk macosx10.10" \ --set DEVELOPER_DIR "$out" wrapProgram $out/bin/xcode-select \ --set DEVELOPER_DIR "$out" - - mkdir -p $out/usr/bin/ - ln -s $out/bin/xcrun $out/usr/bin/xcrun ''; inherit (xcbuild) meta; From 4672fe6998c04b7f8b56785b7bc42efc9f013d2f Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 12 Apr 2017 20:03:29 -0500 Subject: [PATCH 14/15] pinentry_mac: use precompiled .nib's sadly, xib2nib hasn't been working like i though. I've just precompiled into our modified pinentry_mac. Eventually we can get this fixed but it's not as easy as first thought. --- pkgs/tools/security/pinentry-mac/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/security/pinentry-mac/default.nix b/pkgs/tools/security/pinentry-mac/default.nix index 6aa14ab90e7..4cba1c7e617 100644 --- a/pkgs/tools/security/pinentry-mac/default.nix +++ b/pkgs/tools/security/pinentry-mac/default.nix @@ -6,8 +6,8 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "matthewbauer"; repo = "pinentry-mac"; - rev = "77fc993d1040ed2319d9e53af78146be318c1fdd"; - sha256 = "0rkmp6wb8wvmhipavn1bdmbw6564hc2b99dxqysr6yxr2xqs6fcz"; + rev = "d60aa902644a1f0126ec50e79937423a3a7c3bc4"; + sha256 = "0xp4rdyj0mw6gg1z1wraggb1qlkjb5845mibrz3nj0l692da52nq"; }; buildInputs = [ xcbuild libiconv Cocoa ncurses ]; From 9e5fe7738a5abdd2357c3d72899ca1712a36de3a Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 12 Apr 2017 20:07:55 -0500 Subject: [PATCH 15/15] xib2nib: add meta also: - NSPlist - PlistCpp --- pkgs/development/libraries/NSPlist/default.nix | 7 +++++++ pkgs/development/libraries/PlistCpp/default.nix | 8 ++++++++ pkgs/development/tools/xib2nib/default.nix | 7 +++++++ 3 files changed, 22 insertions(+) diff --git a/pkgs/development/libraries/NSPlist/default.nix b/pkgs/development/libraries/NSPlist/default.nix index c06d98876de..bfee9961984 100644 --- a/pkgs/development/libraries/NSPlist/default.nix +++ b/pkgs/development/libraries/NSPlist/default.nix @@ -11,4 +11,11 @@ stdenv.mkDerivation { }; buildInputs = [ cmake ]; + + meta = with stdenv.lib; { + maintainers = with maintainers; [ matthewbauer ]; + description = "Parses .plist files"; + license = licenses.mit; + platforms = platforms.unix; + }; } diff --git a/pkgs/development/libraries/PlistCpp/default.nix b/pkgs/development/libraries/PlistCpp/default.nix index 511915be39f..f7703b731b9 100644 --- a/pkgs/development/libraries/PlistCpp/default.nix +++ b/pkgs/development/libraries/PlistCpp/default.nix @@ -11,4 +11,12 @@ stdenv.mkDerivation { }; buildInputs = [ cmake boost NSPlist pugixml ]; + + + meta = with stdenv.lib; { + maintainers = with maintainers; [ matthewbauer ]; + description = "CPP bindings for Plist"; + license = licenses.mit; + platforms = platforms.unix; + }; } diff --git a/pkgs/development/tools/xib2nib/default.nix b/pkgs/development/tools/xib2nib/default.nix index 5f516ee97cb..d585a35b0bc 100644 --- a/pkgs/development/tools/xib2nib/default.nix +++ b/pkgs/development/tools/xib2nib/default.nix @@ -12,4 +12,11 @@ stdenv.mkDerivation { buildInputs = [ PlistCpp pugixml boost ]; makeFlags = [ "PREFIX=$(out)" ]; + + meta = with stdenv.lib; { + maintainers = with maintainers; [ matthewbauer ]; + description = "Compiles CocoaTouch .xib files into .nib"; + license = licenses.mit; + platforms = platforms.unix; + }; }