diff options
author | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2023-03-12 00:38:29 +0200 |
---|---|---|
committer | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2023-03-12 00:38:29 +0200 |
commit | 225e81da264db63393901ae43d0cd8eebf2298c3 (patch) | |
tree | d9e675f45cda9c5c8bf9def8b71af7182f3c8b70 /pkgs/tools/cd-dvd | |
parent | 1bf544bf5e11c0862e4117d0879dc9bc5a6345ec (diff) |
dvdplusrwtools: add darwin support
Diffstat (limited to 'pkgs/tools/cd-dvd')
-rw-r--r-- | pkgs/tools/cd-dvd/dvd+rw-tools/darwin.patch | 17 | ||||
-rw-r--r-- | pkgs/tools/cd-dvd/dvd+rw-tools/default.nix | 25 |
2 files changed, 37 insertions, 5 deletions
diff --git a/pkgs/tools/cd-dvd/dvd+rw-tools/darwin.patch b/pkgs/tools/cd-dvd/dvd+rw-tools/darwin.patch new file mode 100644 index 0000000000000..7a7490c52673e --- /dev/null +++ b/pkgs/tools/cd-dvd/dvd+rw-tools/darwin.patch @@ -0,0 +1,17 @@ +diff --git a/Makefile.m4 b/Makefile.m4 +index a6a100b..bf7c041 100644 +--- a/Makefile.m4 ++++ b/Makefile.m4 +@@ -30,8 +32,10 @@ LINK.o =$(LINK.cc) + # to install set-root-uid, `make BIN_MODE=04755 install'... + BIN_MODE?=0755 + install: dvd+rw-tools +- install -o root -m $(BIN_MODE) $(CHAIN) /usr/bin +- install -o root -m 0644 growisofs.1 /usr/share/man/man1 ++ install -d $(prefix)/bin ++ install -d $(prefix)/share/man/man1 ++ install -m $(BIN_MODE) $(CHAIN) $(prefix)/bin ++ install -m 0644 growisofs.1 $(prefix)/share/man/man1 + ]) + + ifelse(OS,MINGW32,[ diff --git a/pkgs/tools/cd-dvd/dvd+rw-tools/default.nix b/pkgs/tools/cd-dvd/dvd+rw-tools/default.nix index d396bf030ca63..a618d93214f62 100644 --- a/pkgs/tools/cd-dvd/dvd+rw-tools/default.nix +++ b/pkgs/tools/cd-dvd/dvd+rw-tools/default.nix @@ -1,5 +1,8 @@ -{ lib, stdenv, fetchurl, fetchpatch, cdrtools, m4 }: +{ lib, stdenv, fetchurl, fetchpatch, cdrtools, m4, darwin }: +let + inherit (darwin.apple_sdk.frameworks) IOKit; +in stdenv.mkDerivation rec { pname = "dvd+rw-tools"; version = "7.1"; @@ -9,8 +12,8 @@ stdenv.mkDerivation rec { sha256 = "1jkjvvnjcyxpql97xjjx0kwvy70kxpiznr2zpjy2hhci5s10zmpq"; }; + patches = [ ./darwin.patch ] # Patches from Gentoo - patches = [ ] ++ builtins.map ({pfile, sha256}: fetchpatch { url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/app-cdr/dvd+rw-tools/files/${pfile}?id=b510df361241e8f16314b1f14642305f0111dac6"; inherit sha256; @@ -28,14 +31,26 @@ stdenv.mkDerivation rec { ]; nativeBuildInputs = [ m4 ]; - buildInputs = [ cdrtools ]; + buildInputs = [ cdrtools ] + ++ lib.optionals stdenv.isDarwin [ IOKit ]; - makeFlags = [ "prefix=${placeholder "out"}" ]; + makeFlags = [ + "prefix=${placeholder "out"}" + "CC=${stdenv.cc.targetPrefix}cc" + "CXX=${stdenv.cc.targetPrefix}c++" + ]; + + env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isDarwin [ + # error: invalid suffix on literal; C++11 requires a space between literal and identifier + "-Wno-reserved-user-defined-literal" + # error: non-constant-expression cannot be narrowed from type 'size_t' (aka 'unsigned long') to 'IOByteCount' (aka 'unsigned int') in initializer list + "-Wno-c++11-narrowing" + ]); meta = with lib; { homepage = "http://fy.chalmers.se/~appro/linux/DVD+RW/tools"; description = "Tools for mastering Blu-ray and DVD+-RW/+-R media"; - platforms = platforms.linux; + platforms = platforms.unix; license = with licenses; [ gpl2 publicDomain ]; }; } |