Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4555a0123253
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 098ecfba8f2c
Choose a head ref
  • 4 commits
  • 2 files changed
  • 4 contributors

Commits on Sep 7, 2018

  1. gn: 20180423 -> 20180830

    gn sources have been moved into separate repository which greatly
    simplify build process.
    YorikSar committed Sep 7, 2018
    Copy the full SHA
    55d8a53 View commit details

Commits on Sep 13, 2018

  1. glava: 1.4.5 -> 1.5.1

    eadwu committed Sep 13, 2018
    Copy the full SHA
    bdac537 View commit details

Commits on Sep 14, 2018

  1. Merge pull request #46328 from YorikSar/gn

    gn: 20180423 -> 20180830
    7c6f434c authored Sep 14, 2018
    Copy the full SHA
    3aeb606 View commit details
  2. Merge pull request #46590 from eadwu/glava/1.5.1

    glava: 1.4.5 -> 1.5.1
    srhb authored Sep 14, 2018
    Copy the full SHA
    098ecfb View commit details
Showing with 25 additions and 122 deletions.
  1. +7 −18 pkgs/applications/misc/glava/default.nix
  2. +18 −104 pkgs/development/tools/build-managers/gn/default.nix
25 changes: 7 additions & 18 deletions pkgs/applications/misc/glava/default.nix
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
{ stdenv, fetchurl, writeScript, fetchFromGitHub
{ stdenv, fetchgit, fetchurl, writeScript
, libGL, libX11, libXext, python3, libXrandr, libXrender, libpulseaudio, libXcomposite
, enableGlfw ? false, glfw }:

let
inherit (stdenv.lib) optional makeLibraryPath;

version = "1.4.5";
gladVersion = "0.1.24";
# glad
# https://github.com/wacossusca34/glava/issues/46#issuecomment-397816520
glad = fetchFromGitHub {
owner = "Dav1dde";
repo = "glad";
rev = "v${gladVersion}";
sha256 = "0s2c9w064kqa5i07w8zmvgpg1pa3wj86l1nhgw7w56cjhq7cf8h8";
};
# gl.xml
gl = fetchurl {
url = https://raw.githubusercontent.com/KhronosGroup/OpenGL-Registry/a24f3f7a4c924fdbc666024f99c70e5b8e34c819/xml/gl.xml;
sha256 = "1mskxjmhb35m8qv255pibf633d8sn1w9rdsf0lj75bhlgy0zi5c7";
url = https://raw.githubusercontent.com/KhronosGroup/OpenGL-Registry/56312cfe680e4be5ae61bbf1c628e420f8731718/xml/gl.xml;
sha256 = "1c45bcgaxiic5gmb3gkrd9qcvascvij97vz5y6fc3a2y7x3gjc5l";
};
# EGL 1.5
egl = fetchurl {
@@ -43,12 +33,12 @@ let
in
stdenv.mkDerivation rec {
name = "glava-${version}";
version = "1.5.1";

src = fetchFromGitHub {
owner = "wacossusca34";
repo = "glava";
src = fetchgit {
url = "https://github.com/wacossusca34/glava.git";
rev = "v${version}";
sha256 = "1zfw8samrzxxbny709rcdz1z77cw1cd46wlfnf7my02kipmqn0nr";
sha256 = "1k8x0a0g2pm7ficsk4az9s7mjbm85a987apjg5c4y6iyldxgd6sb";
};

buildInputs = [
@@ -65,7 +55,6 @@ in
];

patchPhase = ''
cp -r --no-preserve=all ${glad}/* glad
mkdir -p glad/include/KHR
cp ${gl} glad/gl.xml
122 changes: 18 additions & 104 deletions pkgs/development/tools/build-managers/gn/default.nix
Original file line number Diff line number Diff line change
@@ -1,133 +1,47 @@
{ stdenv, lib, fetchgit, fetchzip, fetchpatch
, libevent, ninja, python, darwin }:
{ stdenv, lib, fetchgit, fetchzip, fetchpatch, darwin
, git, ninja, python }:

let
depsGit = {
"tools/gn" = fetchgit {
url = "https://chromium.googlesource.com/chromium/src/tools/gn";
rev = "0fa417a0d2d8484e9a5a636e3301da322f586601";
sha256 = "0pigcl14yc4aak6q1ghfjxdz2ah4fg4m2r5y3asw2rz6mpr5y9z0";
};
"base" = fetchgit {
url = "https://chromium.googlesource.com/chromium/src/base";
rev = "ab1d7c3b92ce9c9bc756bdefb8338360d1a33a1e";
sha256 = "15wis6qg9ka62k6v1vamg0bp3v5vkpapg485jsn4bbfcaqp6di0f";
};
"build" = fetchgit {
url = "https://chromium.googlesource.com/chromium/src/build";
rev = "8d44c08a4c9997695db8098198bdd5026bc7a6f9";
sha256 = "19sajgf55xfmvnwvy2ss7g6pyljp751cfsws30w415m6m00lmpxl";
};
"config" = fetchgit {
url = "https://chromium.googlesource.com/chromium/src/build/config";
rev = "14116c0cdcb9e28995ca8bb384a12e5c9dbd1dbb";
sha256 = "04nif0lm4wcy05b7xhal023874s4r0iq067q57cgwdm72i2gml40";
};
"testing/gtest" = fetchgit {
url = "https://chromium.googlesource.com/chromium/testing/gtest";
rev = "585ec31ea716f08233a815e680fc0d4699843938";
sha256 = "0csn1cza66851nmxxiw42smsm3422mx67vcyykwn0a71lcjng6rc";
};
"third_party/apple_apsl" = fetchzip {
url = "https://chromium.googlesource.com/chromium/src/third_party/+archive/8e6ccb8c74db6dfa15dd21401ace3ac96c054cf7/apple_apsl.tar.gz";
sha256 = "1vgcg741lwz84kdy0qc5wn9dxx3j9zh6a9d185fpygdsipwikqv8";
stripRoot = false;
};
"buildtools/third_party/libc++/trunk" = fetchgit {
url = "https://chromium.googlesource.com/chromium/llvm-project/libcxx";
rev = "ece1de8658d749e19c12cacd4458cc330eca94e3";
sha256 = "1nlyvfkzhchwv9b18bh82jcamqv3acj26ah9ajs31f2dql05amhg";
};
"buildtools/third_party/libc++abi/trunk" = fetchgit {
url = "https://chromium.googlesource.com/chromium/llvm-project/libcxxabi";
rev = "52c7a3760aef1df328a9bc957f686410872f0dc0";
sha256 = "1aam539j01381q27b7xhij18pz3h0lhw08hglvqq4hgvlqx5cn2s";
};
};

in stdenv.mkDerivation rec {
stdenv.mkDerivation rec {
name = "gn-${version}";
version = "20180423";
sourceRoot = ".";

unpackPhase = ''
${lib.concatStringsSep "\n" (
lib.mapAttrsToList (n: v: ''
mkdir -p $sourceRoot/${n}
if [ -d ${v} ]; then
cp -r ${v}/* $sourceRoot/${n}
else
mkdir -p $sourceRoot/${n}
pushd $sourceRoot/${n}
unpackFile ${v}
popd
fi
'') depsGit)}
chmod u+w -R $sourceRoot
'';

patches = [
(fetchpatch {
url = "https://raw.githubusercontent.com/Eloston/ungoogled-chromium/3375fbc7b865dafe1230431a1e3f9bffd27ec184/resources/patches/ungoogled-chromium/macos/fix-gn-bootstrap.patch";
sha256 = "1h8jgxznm7zrxlzb4wcfx4zx4lyvfrmpd0r7cd7h0s23wn8ibb3a";
})
];
version = "20180830";

src = fetchgit {
url = "https://gn.googlesource.com/gn";
rev = "106b823805adcc043b2bfe5bc21d58f160a28a7b";
leaveDotGit = true; # gen.py uses "git describe" to generate last_commit_position.h
deepClone = true;
sha256 = "1276jwk3424i78zp21f6hp7idvg6r8qxp8sdfaw8ilkmp7ss19c8";
};

postPatch = ''
# Disable libevent bootstrapping (we will provide it).
sed -i -e '/static_libraries.*libevent/,/^ *\]\?[})]$/d' \
tools/gn/bootstrap/bootstrap.py
# FIXME Needed with old Apple SDKs
substituteInPlace base/mac/foundation_util.mm \
--replace "NSArray<NSString*>*" "NSArray*"
substituteInPlace base/mac/sdk_forward_declarations.h \
--replace "NSDictionary<VNImageOption, id>*" "NSDictionary*" \
--replace "NSArray<VNRequest*>*" "NSArray*" \
--replace "typedef NSString* VNImageOption NS_STRING_ENUM" "typedef NSString* VNImageOption"
# Patch shebangs (for sandbox build)
patchShebangs build
'';

# FIXME again this shouldn't be necessary but I can't figure out a better way
NIX_CFLAGS_COMPILE = "-DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_10 -DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_10";

NIX_LDFLAGS = "-levent";

nativeBuildInputs = [ ninja python ];
buildInputs = [ libevent ]

# FIXME These dependencies shouldn't be needed but can't find a way
# around it. Chromium pulls this in while bootstrapping GN.
++ lib.optionals stdenv.isDarwin (with darwin; with apple_sdk.frameworks; [
nativeBuildInputs = [ ninja python git ];
buildInputs = lib.optionals stdenv.isDarwin (with darwin; with apple_sdk.frameworks; [
libobjc
cctools

# frameworks
ApplicationServices
Foundation
AppKit
ImageCaptureCore
CoreBluetooth
IOBluetooth
CoreWLAN
Quartz
Cocoa
]);

buildPhase = ''
python tools/gn/bootstrap/bootstrap.py -s
python build/gen.py --no-sysroot
ninja -j $NIX_BUILD_CORES -C out gn
'';

installPhase = ''
install -vD out/Release/gn "$out/bin/gn"
install -vD out/gn "$out/bin/gn"
'';

meta = with lib; {
description = "A meta-build system that generates NinjaBuild files";
homepage = https://chromium.googlesource.com/chromium/src/tools/gn;
homepage = https://gn.googlesource.com/gn;
license = licenses.bsd3;
platforms = platforms.unix;
maintainers = with maintainers; [ stesie matthewbauer ];