From 078b69f2e2e0ee7c1180922b0fb85fde508d56cf Mon Sep 17 00:00:00 2001 From: Guillaume Bouchard Date: Mon, 19 Mar 2018 11:47:40 +0100 Subject: [PATCH] Add tentative for Ati version --- README.md | 8 ++++++++ default.nix | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e50f285..04949c3 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,14 @@ nix-build -A nixGLNvidiaBumblebee --argstr nvidiaVersion 390.25 (replace `390.25` with the host driver version gathered earlier.) +For Ati (untested): + +``` +nix-build ./default.nix -A nixGLAti --argstr atiUrl "https://www2.ati.com/drivers/linux/radeon-crimson-15.12-15.302-151217a-297685e.zip" --argstr atiVersion "15.12" +``` + +(replace the url and the version with the correct ones. At the time of this writting, I have no idea on how we can detect that, ati seems to have a weird file naming convention). + ## Install ``` diff --git a/default.nix b/default.nix index d666479..f05f4f1 100644 --- a/default.nix +++ b/default.nix @@ -1,5 +1,7 @@ { system ? builtins.currentSystem, - nvidiaVersion ? null + nvidiaVersion ? null, + atiUrl ? null, + atiVersion ? null }: let @@ -21,6 +23,18 @@ rec { useGLVND = 0; }); + ati = (linuxPackages.ati_drivers_x11.override { + libsOnly = true; + kernel = null; + }).overrideAttrs(oldAttrs : rec { + name = "ati_drivers-${atiVersion}"; + src = fetchurl { + url = atiUrl; + sha256 = null; + curlOpts = "--referer http://support.amd.com/en-us/download/desktop?os=Linux+x86_64"; + }; + }); + nixGLNvidiaBumblebee = runCommand "nixGLNvidiaBumblebee-${version}" { buildInputs = [ nvidiaLibsOnly bumblebee ]; @@ -74,4 +88,22 @@ rec { chmod u+x $out/bin/nixGLIntel ''; + + nixGLAti = runCommand "nixGLAti-${version}" { + buildInputs = [ mesa_drivers ]; + + meta = with pkgs.stdenv.lib; { + description = "A tool to launch OpenGL application on system other than NixOS - Ati version"; + homepage = "https://github.com/guibou/nixGL"; + }; + } '' + mkdir -p $out/bin + cat > $out/bin/nixGLAti << FOO + #!/usr/bin/env sh + export LD_LIBRARY_PATH=${ati}/lib + "\$@" + FOO + + chmod u+x $out/bin/nixGLAti + ''; }