about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/portmidi
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-02-22 10:43:06 +0000
committerAlyssa Ross <hi@alyssa.is>2022-03-11 16:17:56 +0000
commitca1aada113c0ebda1ab8667199f6453f8e01c4fc (patch)
tree55e402280096f62eb0bc8bcad5ce6050c5a0aec7 /nixpkgs/pkgs/development/libraries/portmidi
parente4df5a52a6a6531f32626f57205356a773ac2975 (diff)
parent93883402a445ad467320925a0a5dbe43a949f25b (diff)
downloadnixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar
nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.gz
nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.bz2
nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.lz
nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.xz
nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.zst
nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.zip
Merge commit '93883402a445ad467320925a0a5dbe43a949f25b'
Conflicts:
	nixpkgs/nixos/modules/programs/ssh.nix
	nixpkgs/pkgs/applications/networking/browsers/firefox/packages.nix
	nixpkgs/pkgs/data/fonts/noto-fonts/default.nix
	nixpkgs/pkgs/development/go-modules/generic/default.nix
	nixpkgs/pkgs/development/interpreters/ruby/default.nix
	nixpkgs/pkgs/development/libraries/mesa/default.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/portmidi')
-rw-r--r--nixpkgs/pkgs/development/libraries/portmidi/default.nix63
-rw-r--r--nixpkgs/pkgs/development/libraries/portmidi/missing-header.diff12
-rw-r--r--nixpkgs/pkgs/development/libraries/portmidi/remove-darwin-variables.diff52
3 files changed, 24 insertions, 103 deletions
diff --git a/nixpkgs/pkgs/development/libraries/portmidi/default.nix b/nixpkgs/pkgs/development/libraries/portmidi/default.nix
index 2b8f006a7558..43699291d362 100644
--- a/nixpkgs/pkgs/development/libraries/portmidi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/portmidi/default.nix
@@ -1,66 +1,27 @@
-{ lib, stdenv, fetchurl, unzip, cmake, /*jdk,*/ alsa-lib, Carbon, CoreAudio, CoreFoundation, CoreMIDI, CoreServices }:
+{ lib, stdenv, fetchFromGitHub, unzip, cmake, alsa-lib, Carbon, CoreAudio, CoreFoundation, CoreMIDI, CoreServices }:
 
 stdenv.mkDerivation rec {
   pname = "portmidi";
-  version = "234";
+  version = "2.0.2";
 
-  src = fetchurl {
-    url = "mirror://sourceforge/portmedia/portmedia-code-r${version}.zip";
-    sha256 = "1g7i8hgarihycadbgy2f7lifiy5cbc0mcrcazmwnmbbh1bqx6dyp";
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "zOmzJ2MLGhGXiN0XjcmnnUrk/uqxP9IaZbqCG5XchC4=";
   };
 
-  prePatch = ''
-    cd portmidi/trunk
-  '';
-
-  cmakeFlags = let
-    #base = "${jdk}/jre/lib/${jdk.architecture}";
-  in [
-    "-DPORTMIDI_ENABLE_JAVA=0"
-    /* TODO: Fix Java support.
-    "-DJAVA_AWT_LIBRARY=${base}/libawt.so"
-    "-DJAVA_JVM_LIBRARY=${base}/server/libjvm.so"
-    */
+  cmakeFlags = [
     "-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=Release"
     "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=Release"
     "-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=Release"
-  ] ++ lib.optionals stdenv.isDarwin [
-    "-DCMAKE_OSX_ARCHITECTURES=${if stdenv.isAarch64 then "arm64" else "x86_64"}"
-    "-DCOREAUDIO_LIB=${CoreAudio}"
-    "-DCOREFOUNDATION_LIB=${CoreFoundation}"
-    "-DCOREMIDI_LIB=${CoreMIDI}"
-    "-DCORESERVICES_LIB=${CoreServices}"
-  ];
-
-  NIX_LDFLAGS = lib.optionalString stdenv.isDarwin [
-    "-framework CoreAudio"
-    "-framework CoreFoundation"
-    "-framework CoreMIDI"
-    "-framework CoreServices"
   ];
 
   patches = [
-    # XXX: This is to deactivate Java support.
-    (fetchurl {
-      url = "https://raw.github.com/Rogentos/argent-gentoo/master/media-libs/portmidi/files/portmidi-217-cmake-libdir-java-opts.patch";
-      sha256 = "1jbjwan61iqq9fqfpq2a4fd30k3clg7a6j0gfgsw87r8c76kqf6h";
-    })
-  ] ++ lib.optionals stdenv.isDarwin [
-    # Remove hardcoded variables so we can set them properly
-    ./remove-darwin-variables.diff
+    # Add missing header include
+    ./missing-header.diff
   ];
 
-  postPatch = ''
-    sed -i -e 's|/usr/local/|'"$out"'|' -e 's|/usr/share/|'"$out"'/share/|' \
-      pm_common/CMakeLists.txt pm_dylib/CMakeLists.txt pm_java/CMakeLists.txt
-    sed -i \
-        -e 's|-classpath .|-classpath '"$(pwd)"'/pm_java|' \
-        -e 's|pmdefaults/|'"$(pwd)"'/pm_java/&|g' \
-        -e 's|jportmidi/|'"$(pwd)"'/pm_java/&|g' \
-        -e 's/WORKING_DIRECTORY pm_java//' \
-        pm_java/CMakeLists.txt
-  '';
-
   postInstall = let ext = stdenv.hostPlatform.extensions.sharedLibrary; in ''
     ln -s libportmidi${ext} "$out/lib/libporttime${ext}"
   '';
@@ -75,10 +36,10 @@ stdenv.mkDerivation rec {
   hardeningDisable = [ "format" ];
 
   meta = with lib; {
-    homepage = "http://portmedia.sourceforge.net/portmidi/";
+    homepage = "https://github.com/PortMidi/portmidi";
     description = "Platform independent library for MIDI I/O";
     license = licenses.mit;
-    maintainers = with maintainers; [ angustrau ];
+    maintainers = with maintainers; [ emilytrau ];
     platforms = platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/portmidi/missing-header.diff b/nixpkgs/pkgs/development/libraries/portmidi/missing-header.diff
new file mode 100644
index 000000000000..1fa1f147014e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/portmidi/missing-header.diff
@@ -0,0 +1,12 @@
+diff --git a/porttime/ptmacosx_mach.c b/porttime/ptmacosx_mach.c
+index 10c3554..712a974 100755
+--- a/porttime/ptmacosx_mach.c
++++ b/porttime/ptmacosx_mach.c
+@@ -12,6 +12,7 @@
+ 

+ #include "porttime.h"

+ #include "sys/time.h"

++#include "sys/qos.h"

+ #include "pthread.h"

+ 

+ #ifndef NSEC_PER_MSEC

diff --git a/nixpkgs/pkgs/development/libraries/portmidi/remove-darwin-variables.diff b/nixpkgs/pkgs/development/libraries/portmidi/remove-darwin-variables.diff
deleted file mode 100644
index 15ed874f172f..000000000000
--- a/nixpkgs/pkgs/development/libraries/portmidi/remove-darwin-variables.diff
+++ /dev/null
@@ -1,52 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 4919b78..758eccb 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -36,8 +36,6 @@ set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused")
- set(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused")
- set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused")
- 
--set(CMAKE_OSX_ARCHITECTURES i386 ppc x86_64 CACHE STRING "change to needed architecture for a smaller library" FORCE)
--
- PROJECT(portmidi)
- 
- if(UNIX)
-diff --git a/pm_common/CMakeLists.txt b/pm_common/CMakeLists.txt
-index cbeeade..f765430 100644
---- a/pm_common/CMakeLists.txt
-+++ b/pm_common/CMakeLists.txt
-@@ -22,7 +22,7 @@ else(APPLE OR WIN32)
- endif(APPLE OR WIN32)
- 
- if(APPLE)
--  set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk CACHE 
-+  set(CMAKE_OSX_SYSROOT / CACHE 
-       PATH "-isysroot parameter for compiler")
-   set(CMAKE_C_FLAGS "-mmacosx-version-min=10.6" CACHE 
-       STRING "needed in conjunction with CMAKE_OSX_SYSROOT" FORCE)
-@@ -54,10 +54,6 @@ if(UNIX)
- 
-     include_directories(${CMAKE_OSX_SYSROOT}/Developer/Headers/FlatCarbon)
-     set(FRAMEWORK_PATH ${CMAKE_OSX_SYSROOT}/System/Library/Frameworks)
--    set(COREAUDIO_LIB "${FRAMEWORK_PATH}/CoreAudio.framework")
--    set(COREFOUNDATION_LIB "${FRAMEWORK_PATH}/CoreFoundation.framework")
--    set(COREMIDI_LIB "${FRAMEWORK_PATH}/CoreMIDI.framework")
--    set(CORESERVICES_LIB "${FRAMEWORK_PATH}/CoreServices.framework")
-     set(PM_NEEDED_LIBS ${COREAUDIO_LIB} ${COREFOUNDATION_LIB}
-                              ${COREMIDI_LIB} ${CORESERVICES_LIB}
-         CACHE INTERNAL "")
-diff --git a/pm_dylib/CMakeLists.txt b/pm_dylib/CMakeLists.txt
-index f693dd6..1dc5cd6 100644
---- a/pm_dylib/CMakeLists.txt
-+++ b/pm_dylib/CMakeLists.txt
-@@ -49,10 +49,6 @@ if(UNIX)
- 
-     include_directories(${CMAKE_OSX_SYSROOT}/Developer/Headers/FlatCarbon)
-     set(FRAMEWORK_PATH ${CMAKE_OSX_SYSROOT}/System/Library/Frameworks)
--    set(COREAUDIO_LIB "${FRAMEWORK_PATH}/CoreAudio.framework")
--    set(COREFOUNDATION_LIB "${FRAMEWORK_PATH}/CoreFoundation.framework")
--    set(COREMIDI_LIB "${FRAMEWORK_PATH}/CoreMIDI.framework")
--    set(CORESERVICES_LIB "${FRAMEWORK_PATH}/CoreServices.framework")
-     set(PM_NEEDED_LIBS ${COREAUDIO_LIB} ${COREFOUNDATION_LIB}
-                              ${COREMIDI_LIB} ${CORESERVICES_LIB}
-         CACHE INTERNAL "")