darwin.AvailabilityVersions: use mkAppleDerivation
This commit is contained in:
parent
4624bd7959
commit
78076b3c12
@ -1,16 +1,26 @@
|
|||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
stdenvNoCC,
|
apple-sdk,
|
||||||
appleDerivation',
|
buildPackages,
|
||||||
gnused,
|
mkAppleDerivation,
|
||||||
python3,
|
|
||||||
unifdef,
|
unifdef,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
appleDerivation' stdenvNoCC {
|
let
|
||||||
nativeBuildInputs = [ unifdef ];
|
inherit (buildPackages) gnused python3;
|
||||||
|
in
|
||||||
|
mkAppleDerivation (finalAttrs: {
|
||||||
|
releaseName = "AvailabilityVersions";
|
||||||
|
|
||||||
patches = [ ./0001-Support-setting-an-upper-bound-on-versions.patch ];
|
patches = [
|
||||||
|
# Add support for setting an upper bound, which is needed by the `gen-headers` script.
|
||||||
|
# It avoids having pre-process the DSL to remove unwanted versions.
|
||||||
|
./patches/0001-Support-setting-an-upper-bound-on-versions.patch
|
||||||
|
];
|
||||||
|
|
||||||
|
noCC = true;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ unifdef ];
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
runHook preBuild
|
runHook preBuild
|
||||||
@ -33,7 +43,7 @@ appleDerivation' stdenvNoCC {
|
|||||||
cp -r availability.dsl templates "$out/share/availability/"
|
cp -r availability.dsl templates "$out/share/availability/"
|
||||||
|
|
||||||
substitute availability "$out/libexec/availability" \
|
substitute availability "$out/libexec/availability" \
|
||||||
--replace-fail '/usr/bin/env python3' '${lib.getBin python3}/bin/python3' \
|
--replace-fail '/usr/bin/env python3' '${lib.getExe python3}' \
|
||||||
--replace-fail 'f"{os.path.abspath(os.path.dirname(sys.argv[0]))}/' "\"$out/share/availability/"
|
--replace-fail 'f"{os.path.abspath(os.path.dirname(sys.argv[0]))}/' "\"$out/share/availability/"
|
||||||
chmod a+x "$out/libexec/availability"
|
chmod a+x "$out/libexec/availability"
|
||||||
|
|
||||||
@ -61,7 +71,7 @@ appleDerivation' stdenvNoCC {
|
|||||||
--preprocess "$out/share/availability/templates/\$header_src" "\$dest/include/\$header"
|
--preprocess "$out/share/availability/templates/\$header_src" "\$dest/include/\$header"
|
||||||
done
|
done
|
||||||
|
|
||||||
# `__ENVIRONMENT_OS_VERSION_MIN_REQUIRED__` is only defined by clang 17+, so define it for older versions.
|
# __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__ is only defined by clang 17+, so define it for older versions.
|
||||||
${lib.getExe gnused} -E '/#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED/{
|
${lib.getExe gnused} -E '/#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED/{
|
||||||
i#ifndef __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
|
i#ifndef __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
|
||||||
i#define __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
|
i#define __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
|
||||||
@ -95,5 +105,9 @@ appleDerivation' stdenvNoCC {
|
|||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta.mainProgram = "gen-headers";
|
meta = {
|
||||||
}
|
description = "Generates Darwin Availability headers";
|
||||||
|
mainProgram = "gen-headers";
|
||||||
|
platforms = lib.platforms.unix;
|
||||||
|
};
|
||||||
|
})
|
@ -260,7 +260,7 @@ developerToolsPackages_11_3_1 // macosPackages_11_0_1 // {
|
|||||||
|
|
||||||
inherit (self.adv_cmds) ps locale;
|
inherit (self.adv_cmds) ps locale;
|
||||||
architecture = applePackage "architecture" "osx-10.11.6" "sha256-cUKeMx6mOAxBSRHIdfzsrR65Qv86m7+20XvpKqVfwVI=" {};
|
architecture = applePackage "architecture" "osx-10.11.6" "sha256-cUKeMx6mOAxBSRHIdfzsrR65Qv86m7+20XvpKqVfwVI=" {};
|
||||||
AvailabilityVersions = applePackage "AvailabilityVersions" "macos-14.4" "sha256-O9/EOsbK5ZXxh6iDSTwGWWrY5GX/viUwdfG3tdvZwcQ=" {};
|
AvailabilityVersions = callPackage ./AvailabilityVersions/package.nix { };
|
||||||
bsdmake = applePackage "bsdmake" "dev-tools-3.2.6" "sha256-CW8zP5QZMhWTGp+rhrm8oHE/vSLsRlv1VRAGe1OUDmI=" {};
|
bsdmake = applePackage "bsdmake" "dev-tools-3.2.6" "sha256-CW8zP5QZMhWTGp+rhrm8oHE/vSLsRlv1VRAGe1OUDmI=" {};
|
||||||
CarbonHeaders = applePackage "CarbonHeaders" "osx-10.6.2" "sha256-UNaHvxzYzEBnYYuoMLqWUVprZa6Wqn/3XleoSCco050=" {};
|
CarbonHeaders = applePackage "CarbonHeaders" "osx-10.6.2" "sha256-UNaHvxzYzEBnYYuoMLqWUVprZa6Wqn/3XleoSCco050=" {};
|
||||||
CommonCrypto = applePackage "CommonCrypto" "osx-10.12.6" "sha256-FLgODBrfv+XsGaAjddncYAm/BIJJYw6LcwX/z7ncKFM=" {};
|
CommonCrypto = applePackage "CommonCrypto" "osx-10.12.6" "sha256-FLgODBrfv+XsGaAjddncYAm/BIJJYw6LcwX/z7ncKFM=" {};
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
{
|
{
|
||||||
|
"AvailabilityVersions": {
|
||||||
|
"hash": "sha256-O9/EOsbK5ZXxh6iDSTwGWWrY5GX/viUwdfG3tdvZwcQ=",
|
||||||
|
"version": "140.1"
|
||||||
|
},
|
||||||
"adv_cmds": {
|
"adv_cmds": {
|
||||||
"hash": "sha256-Ztp8ALWcviEpthoiY8ttWzGI8OcsLzsULjlqe8GIzw8=",
|
"hash": "sha256-Ztp8ALWcviEpthoiY8ttWzGI8OcsLzsULjlqe8GIzw8=",
|
||||||
"version": "163"
|
"version": "163"
|
||||||
|
Loading…
Reference in New Issue
Block a user