nixpkgs/pkgs/by-name/ow/owl-compositor/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

88 lines
2.2 KiB
Nix

{ lib
, clangStdenv
, fetchFromGitHub
, gnustep
, libxkbcommon
, makeWrapper
, wayland
, wayland-scanner
, darwin
}:
let
stdenv = clangStdenv;
in
stdenv.mkDerivation {
pname = "owl-compositor";
version = "unstable-2021-11-10";
src = fetchFromGitHub {
owner = "owl-compositor";
repo = "owl";
rev = "91abf02613cd2ddb97be58b5b6703240320233a0";
hash = "sha256-a+TznasOVEzSNrs66/y91AeMRDEfyd+WO5mO811hLj0=";
};
# use pregenerated nib files because generating them requires Xcode
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
sed -i "/ibtool/d" configure
mkdir -p build/Owl.app/Contents/Resources/English.lproj
cp ${./mac/MainMenu.nib} build/Owl.app/Contents/Resources/English.lproj/MainMenu.nib
cp ${./mac/OwlPreferences.nib} build/Owl.app/Contents/Resources/English.lproj/OwlPreferences.nib
'';
strictDeps = true;
nativeBuildInputs = [
makeWrapper
wayland-scanner
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.DarwinTools
darwin.bootstrap_cmds
] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
gnustep.make
gnustep.wrapGNUstepAppsHook
];
buildInputs = [
libxkbcommon
wayland
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.Cocoa
] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
gnustep.back
gnustep.base
gnustep.gui
];
preConfigure = ''
mkdir -p build
cd build
'';
configureScript = "../configure";
# error: "Your gnustep-base was configured for the objc-nonfragile-abi but you are not using it now."
env.NIX_CFLAGS_COMPILE = lib.optionalString (!stdenv.hostPlatform.isDarwin) "-fobjc-runtime=gnustep-2.0";
installPhase = ''
runHook preInstall
mkdir -p $out/{Applications,bin}
mv Owl.app $out/Applications
makeWrapper $out/{Applications/Owl.app${lib.optionalString stdenv.hostPlatform.isDarwin "/Contents/MacOS"},bin}/Owl
runHook postInstall
'';
meta = with lib; {
description = "Portable Wayland compositor in Objective-C";
homepage = "https://github.com/owl-compositor/owl";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ wegank ];
platforms = platforms.unix;
mainProgram = "Owl";
};
}