mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
vim: factor common.nix from {default,configurable}.nix
The derivations are unchanged.
This commit is contained in:
parent
f49f90bfdd
commit
1667046505
23
pkgs/applications/editors/vim/common.nix
Normal file
23
pkgs/applications/editors/vim/common.nix
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{ lib, fetchFromGitHub }:
|
||||||
|
rec {
|
||||||
|
version = "8.0.0005";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "vim";
|
||||||
|
repo = "vim";
|
||||||
|
rev = "v${version}";
|
||||||
|
sha256 = "0ys3l3dr43vjad1f096ch1sl3x2ajsqkd03rdn6n812m7j4wipx0";
|
||||||
|
};
|
||||||
|
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
hardeningDisable = [ "fortify" ];
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "The most popular clone of the VI editor";
|
||||||
|
homepage = http://www.vim.org;
|
||||||
|
license = licenses.vim;
|
||||||
|
maintainers = with maintainers; [ lovek323 ];
|
||||||
|
platforms = platforms.unix;
|
||||||
|
};
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
# TODO tidy up eg The patchelf code is patching gvim even if you don't build it..
|
# TODO tidy up eg The patchelf code is patching gvim even if you don't build it..
|
||||||
# but I have gvim with python support now :) - Marc
|
# but I have gvim with python support now :) - Marc
|
||||||
args@{pkgs, source ? "default", fetchurl, fetchFromGitHub, stdenv, ncurses, pkgconfig, gettext
|
args@{ source ? "default", callPackage, fetchurl, stdenv, ncurses, pkgconfig, gettext
|
||||||
, composableDerivation, lib, config, glib, gtk2, python, perl, tcl, ruby
|
, composableDerivation, writeText, lib, config, glib, gtk2, python, perl, tcl, ruby
|
||||||
, libX11, libXext, libSM, libXpm, libXt, libXaw, libXau, libXmu
|
, libX11, libXext, libSM, libXpm, libXt, libXaw, libXau, libXmu
|
||||||
, libICE
|
, libICE
|
||||||
|
|
||||||
@ -11,8 +11,9 @@ args@{pkgs, source ? "default", fetchurl, fetchFromGitHub, stdenv, ncurses, pkgc
|
|||||||
, ... }: with args;
|
, ... }: with args;
|
||||||
|
|
||||||
|
|
||||||
let inherit (args.composableDerivation) composableDerivation edf;
|
let
|
||||||
nixosRuntimepath = pkgs.writeText "nixos-vimrc" ''
|
inherit (args.composableDerivation) composableDerivation edf;
|
||||||
|
nixosRuntimepath = writeText "nixos-vimrc" ''
|
||||||
set nocompatible
|
set nocompatible
|
||||||
syntax on
|
syntax on
|
||||||
|
|
||||||
@ -37,25 +38,18 @@ let inherit (args.composableDerivation) composableDerivation edf;
|
|||||||
source /etc/vim/vimrc
|
source /etc/vim/vimrc
|
||||||
endif
|
endif
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
common = callPackage ./common.nix {};
|
||||||
in
|
in
|
||||||
composableDerivation {
|
composableDerivation {
|
||||||
} (fix: rec {
|
} (fix: rec {
|
||||||
|
|
||||||
name = "vim_configurable-${version}";
|
name = "vim_configurable-${version}";
|
||||||
version = "8.0.0005";
|
|
||||||
|
|
||||||
enableParallelBuilding = true; # test this
|
inherit (common) version hardeningDisable enableParallelBuilding meta;
|
||||||
|
|
||||||
src =
|
src = builtins.getAttr source {
|
||||||
builtins.getAttr source {
|
"default" = common.src; # latest release
|
||||||
"default" =
|
|
||||||
# latest release
|
|
||||||
args.fetchFromGitHub {
|
|
||||||
owner = "vim";
|
|
||||||
repo = "vim";
|
|
||||||
rev = "v${version}";
|
|
||||||
sha256 = "0ys3l3dr43vjad1f096ch1sl3x2ajsqkd03rdn6n812m7j4wipx0";
|
|
||||||
};
|
|
||||||
|
|
||||||
"vim-nox" =
|
"vim-nox" =
|
||||||
{
|
{
|
||||||
@ -185,15 +179,5 @@ composableDerivation {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
dontStrip = 1;
|
dontStrip = 1;
|
||||||
|
|
||||||
hardeningDisable = [ "fortify" ];
|
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
|
||||||
description = "The most popular clone of the VI editor";
|
|
||||||
homepage = http://www.vim.org;
|
|
||||||
license = licenses.vim;
|
|
||||||
maintainers = with maintainers; [ lovek323 ];
|
|
||||||
platforms = platforms.unix;
|
|
||||||
};
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchFromGitHub, fetchurl, ncurses, gettext, pkgconfig
|
{ stdenv, fetchurl, callPackage, ncurses, gettext, pkgconfig
|
||||||
# default vimrc
|
# default vimrc
|
||||||
, vimrc ? fetchurl {
|
, vimrc ? fetchurl {
|
||||||
name = "default-vimrc";
|
name = "default-vimrc";
|
||||||
@ -8,18 +8,13 @@
|
|||||||
# apple frameworks
|
# apple frameworks
|
||||||
, Carbon, Cocoa }:
|
, Carbon, Cocoa }:
|
||||||
|
|
||||||
|
let
|
||||||
|
common = callPackage ./common.nix {};
|
||||||
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "vim-${version}";
|
name = "vim-${version}";
|
||||||
version = "8.0.0005";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
inherit (common) version src hardeningDisable enableParallelBuilding meta;
|
||||||
owner = "vim";
|
|
||||||
repo = "vim";
|
|
||||||
rev = "v${version}";
|
|
||||||
sha256 = "0ys3l3dr43vjad1f096ch1sl3x2ajsqkd03rdn6n812m7j4wipx0";
|
|
||||||
};
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
buildInputs = [ ncurses pkgconfig ]
|
buildInputs = [ ncurses pkgconfig ]
|
||||||
++ stdenv.lib.optionals stdenv.isDarwin [ Carbon Cocoa ];
|
++ stdenv.lib.optionals stdenv.isDarwin [ Carbon Cocoa ];
|
||||||
@ -30,8 +25,6 @@ stdenv.mkDerivation rec {
|
|||||||
"--enable-nls"
|
"--enable-nls"
|
||||||
];
|
];
|
||||||
|
|
||||||
hardeningDisable = [ "fortify" ];
|
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
ln -s $out/bin/vim $out/bin/vi
|
ln -s $out/bin/vim $out/bin/vi
|
||||||
mkdir -p $out/share/vim
|
mkdir -p $out/share/vim
|
||||||
@ -62,12 +55,4 @@ stdenv.mkDerivation rec {
|
|||||||
# patchPhase = ''
|
# patchPhase = ''
|
||||||
# sed -i -e 's/as_fn_error.*int32.*/:/' src/auto/configure
|
# sed -i -e 's/as_fn_error.*int32.*/:/' src/auto/configure
|
||||||
# '';
|
# '';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
|
||||||
description = "The most popular clone of the VI editor";
|
|
||||||
homepage = http://www.vim.org;
|
|
||||||
license = licenses.vim;
|
|
||||||
maintainers = with maintainers; [ lovek323 ];
|
|
||||||
platforms = platforms.unix;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user