git.iko.soy/typeable/nixpkgs
on master help sign in
iterm2: fix build
commit829ef15879a2cadde366975b20630e77441f1a0c authorJason Pickens <jasonpickensnz@gmail.com> dateThu 17 Feb 2022, 12:20 (5 years ago) parentf844e0d
1 file changed+24−30
pkgs/applications/terminal-emulators/iterm2/default.nix+24−30
pkgs/applications/terminal-emulators/iterm2/default.nix+24−30
@@ -1,48 +1,42 @@
1−{ lib, stdenvNoCC, fetchFromGitHub }:
1+{ fetchzip, lib, stdenvNoCC }:
22
33 /*
4− This derivation is impure: it relies on an Xcode toolchain being installed
5− and available in the expected place. The values of sandboxProfile
6− are copied pretty directly from the MacVim derivation, which
7− is also impure. In order to build you at least need the `sandbox`
8− option set to `relaxed` or `false`.
4+ This cannot be built from source as it requires entitlements and
5+ for that it needs to be code signed. Automatic updates will have
6+ to be disabled via preferences instead of at build time. To do
7+ that edit $HOME/Library/Preferences/com.googlecode.iterm2.plist
8+ and add:
9+ SUEnableAutomaticChecks = 0;
910 */
1011
1112stdenvNoCC.mkDerivation rec {
1213 pname = "iterm2";
13− version = "3.4.14";
14+ version = "3.4.15";
1415
15− src = fetchFromGitHub {
16− owner = "gnachman";
17− repo = "iTerm2";
18− rev = "v${version}";
19− sha256 = "sha256-sDCnBO7xDpecu2cSjpHwync2DVsj9EKUmgpqEVLtxRM=";
16+ src = fetchzip {
17+ url = "https://iterm2.com/downloads/stable/iTerm2-${lib.replaceStrings ["."] ["_"] version}.zip";
18+ sha256 = "sha256-ZE/uYBKB2popdIdZWA8AvyJiwMzt32u6u/H/AyNcoVo=";
2019 };
2120
22− patches = [ ./disable_updates.patch ];
23− postPatch = ''
24− sed -i -e 's/CODE_SIGN_IDENTITY = "Developer ID Application"/CODE_SIGN_IDENTITY = ""/g' ./iTerm2.xcodeproj/project.pbxproj
25− '';
26−
27− preConfigure = "LD=$CC";
28− makeFlagsArray = ["Nix"];
2921 installPhase = ''
30− mkdir -p $out/Applications
31− mv Build/Products/Deployment/iTerm2.app $out/Applications/iTerm.app
32− '';
33−
34− sandboxProfile = ''
35− (allow file-read* file-write* process-exec mach-lookup)
36− ; block homebrew dependencies
37− (deny file-read* file-write* process-exec mach-lookup (subpath "/usr/local") (with no-log))
22+ runHook preInstall
23+ APP_DIR="$out/Applications/iTerm2.app"
24+ mkdir -p "$APP_DIR"
25+ cp -r . "$APP_DIR"
26+ mkdir -p "$out/bin"
27+ cat << EOF > "$out/bin/iterm2"
28+ #!${stdenvNoCC.shell}
29+ open -na "$APP_DIR" --args "$@"
30+ EOF
31+ chmod +x "$out/bin/iterm2"
32+ runHook postInstall
3833 '';
3934
4035 meta = with lib; {
4136 description = "A replacement for Terminal and the successor to iTerm";
4237 homepage = "https://www.iterm2.com/";
4338 license = licenses.gpl2;
44− maintainers = with maintainers; [ tricktron ];
45− platforms = platforms.darwin;
46− hydraPlatforms = [];
39+ maintainers = with maintainers; [ steinybot tricktron ];
40+ platforms = [ "x86_64-darwin" "aarch64-darwin" ];
4741 };
4842}