From 46f4391873154fbdcff4093e7baf820b16d4c8e3 Mon Sep 17 00:00:00 2001 From: Jade Date: Tue, 10 Aug 2021 20:34:42 +0000 Subject: [PATCH 1/3] obs-studio: add aarch64 support --- .../applications/video/obs-studio/default.nix | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/video/obs-studio/default.nix b/pkgs/applications/video/obs-studio/default.nix index d7784279c315..82040203c4f3 100644 --- a/pkgs/applications/video/obs-studio/default.nix +++ b/pkgs/applications/video/obs-studio/default.nix @@ -1,4 +1,6 @@ -{ config, lib, stdenv +{ config +, lib +, stdenv , mkDerivation , fetchFromGitHub , addOpenGLRunpath @@ -41,7 +43,8 @@ let inherit (lib) optional optionals; -in mkDerivation rec { +in +mkDerivation rec { pname = "obs-studio"; version = "27.0.0"; @@ -61,7 +64,13 @@ in mkDerivation rec { ./Change-product_version-to-user_agent_product.patch ]; - nativeBuildInputs = [ addOpenGLRunpath cmake pkg-config ]; + nativeBuildInputs = [ + addOpenGLRunpath + cmake + pkg-config + makeWrapper + ] + ++ optional scriptingSupport swig; buildInputs = [ curl @@ -81,10 +90,9 @@ in mkDerivation rec { wayland x264 libvlc - makeWrapper mbedtls ] - ++ optionals scriptingSupport [ luajit swig python3 ] + ++ optionals scriptingSupport [ luajit python3 ] ++ optional alsaSupport alsa-lib ++ optional pulseaudioSupport libpulseaudio ++ optional pipewireSupport pipewire; @@ -132,7 +140,7 @@ in mkDerivation rec { ''; homepage = "https://obsproject.com"; maintainers = with maintainers; [ jb55 MP2E V ]; - license = licenses.gpl2; - platforms = [ "x86_64-linux" "i686-linux" ]; + license = licenses.gpl2Plus; + platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" ]; }; } From f3209301351de3eed88683489e1fbbf708cd5a4a Mon Sep 17 00:00:00 2001 From: Jade Date: Tue, 10 Aug 2021 20:34:42 +0000 Subject: [PATCH 2/3] libcef: add aarch64 support --- pkgs/development/libraries/libcef/default.nix | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/libcef/default.nix b/pkgs/development/libraries/libcef/default.nix index c3d6516a3dfd..de8164f06e57 100644 --- a/pkgs/development/libraries/libcef/default.nix +++ b/pkgs/development/libraries/libcef/default.nix @@ -1,4 +1,7 @@ -{ lib, stdenv, fetchurl, cmake +{ lib +, stdenv +, fetchurl +, cmake , glib , nss , nspr @@ -52,18 +55,34 @@ let cups libxshmfence ]; -in stdenv.mkDerivation rec { + platforms = { + "aarch64-linux" = { + platformStr = "linuxarm64"; + projectArch = "arm64"; + sha256 = "1j93qawh9h6k2ic70i10npppv5f9dch961lc1wxwsi68daq8r081"; + }; + "x86_64-linux" = { + platformStr = "linux64"; + projectArch = "x86_64"; + sha256 = "1ja711x9fdlf21qw1k9xn3lvjc5zsfgnjga1w1r8sysam73jk7xj"; + }; + }; + + platformInfo = builtins.getAttr stdenv.targetPlatform.system platforms; +in +stdenv.mkDerivation rec { pname = "cef-binary"; version = "90.6.7"; gitRevision = "19ba721"; chromiumVersion = "90.0.4430.212"; src = fetchurl { - url = "https://cef-builds.spotifycdn.com/cef_binary_${version}+g${gitRevision}+chromium-${chromiumVersion}_linux64_minimal.tar.bz2"; - sha256 = "1ja711x9fdlf21qw1k9xn3lvjc5zsfgnjga1w1r8sysam73jk7xj"; + url = "https://cef-builds.spotifycdn.com/cef_binary_${version}+g${gitRevision}+chromium-${chromiumVersion}_${platformInfo.platformStr}_minimal.tar.bz2"; + inherit (platformInfo) sha256; }; nativeBuildInputs = [ cmake ]; + cmakeFlags = "-DPROJECT_ARCH=${platformInfo.projectArch}"; makeFlags = [ "libcef_dll_wrapper" ]; dontStrip = true; dontPatchELF = true; @@ -83,6 +102,6 @@ in stdenv.mkDerivation rec { homepage = "https://cef-builds.spotifycdn.com/index.html"; maintainers = with maintainers; [ puffnfresh ]; license = licenses.bsd3; - platforms = with platforms; linux; + platforms = [ "x86_64-linux" "aarch64-linux" ]; }; } From cee1de0975de331ba3de7734501de311adb2e6f9 Mon Sep 17 00:00:00 2001 From: Jade Date: Wed, 11 Aug 2021 01:16:34 +0000 Subject: [PATCH 3/3] libcef: support i686 Previously, libcef did not actually support i686!! It compiled against a 64 bit chromium, which may have actually worked on CI but it would not work so well on an actual 32 bit machine. --- pkgs/development/libraries/libcef/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/libcef/default.nix b/pkgs/development/libraries/libcef/default.nix index de8164f06e57..85163daad0a1 100644 --- a/pkgs/development/libraries/libcef/default.nix +++ b/pkgs/development/libraries/libcef/default.nix @@ -61,6 +61,11 @@ let projectArch = "arm64"; sha256 = "1j93qawh9h6k2ic70i10npppv5f9dch961lc1wxwsi68daq8r081"; }; + "i686-linux" = { + platformStr = "linux32"; + projectArch = "x86"; + sha256 = "0ki4zr8ih06kirgbpxbinv4baw3qvacx208q6qy1cvpfh6ll4fwb"; + }; "x86_64-linux" = { platformStr = "linux64"; projectArch = "x86_64"; @@ -102,6 +107,6 @@ stdenv.mkDerivation rec { homepage = "https://cef-builds.spotifycdn.com/index.html"; maintainers = with maintainers; [ puffnfresh ]; license = licenses.bsd3; - platforms = [ "x86_64-linux" "aarch64-linux" ]; + platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" ]; }; }