Compare commits
2 Commits
9622dc8382
...
75c3fff58e
Author | SHA1 | Date |
---|---|---|
Sameer Rahmani | 75c3fff58e | |
Sameer Rahmani | 5797bc2615 |
|
@ -20,10 +20,10 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"dirtyRev": "aa8d093e3bede559e5681ca69aa05e6e1ad4ee9a-dirty",
|
"dirtyRev": "60a403eaffc56570ccc2fefebd1e09acd0ceab53-dirty",
|
||||||
"dirtyShortRev": "aa8d093e3bed-dirty",
|
"dirtyShortRev": "60a403eaffc5-dirty",
|
||||||
"lastModified": 1700918627,
|
"lastModified": 1701178202,
|
||||||
"narHash": "sha256-gcbm/2a4Hp4k2dpOl33hGARAiHMHH5HKyCSkzRGhpLQ=",
|
"narHash": "sha256-WcFAx8yBoAGAUH6bCRJQWohtnzARZwpYh0H17LuAPZI=",
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "file:///home/lxsameer/src/nixpkgs"
|
"url": "file:///home/lxsameer/src/nixpkgs"
|
||||||
},
|
},
|
||||||
|
|
187
flake.nix
187
flake.nix
|
@ -1,3 +1,18 @@
|
||||||
|
# Serene Programming Language
|
||||||
|
#
|
||||||
|
# Copyright (c) 2019-2023 Sameer Rahmani <lxsameer@gnu.org>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, version 2.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
{
|
{
|
||||||
description = "Serene programming language";
|
description = "Serene programming language";
|
||||||
|
|
||||||
|
@ -7,6 +22,7 @@
|
||||||
outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
|
outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
let
|
let
|
||||||
|
zshDir = ./scripts/zsh;
|
||||||
llvm = {
|
llvm = {
|
||||||
url = "https://devheroes.codes/Serene/llvm-project.git";
|
url = "https://devheroes.codes/Serene/llvm-project.git";
|
||||||
major = "16";
|
major = "16";
|
||||||
|
@ -16,32 +32,36 @@
|
||||||
rev-version = "17-disable-shared-1";
|
rev-version = "17-disable-shared-1";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
overlays = [
|
overlays = [
|
||||||
(self: super:
|
# (self: super:
|
||||||
{
|
# {
|
||||||
serene_toolchain = (super.callPackage (super.path + "/pkgs/development/compilers/llvm/${llvm.major}") ({
|
# serene_toolchain = (super.callPackage (super.path + "/pkgs/development/compilers/llvm/${llvm.major}") ({
|
||||||
inherit (super.stdenvAdapters) overrideCC;
|
# inherit (super.stdenvAdapters) overrideCC;
|
||||||
buildLlvmTools = super.buildPackages.serene_toolchain.tools;
|
# buildLlvmTools = super.buildPackages.serene_toolchain.tools;
|
||||||
targetLlvmLibraries = self.targetPackages.serene_toolchain.libraries or self.serene_toolchain.libraries;
|
# targetLlvmLibraries = self.targetPackages.serene_toolchain.libraries or self.serene_toolchain.libraries;
|
||||||
targetLlvm = self.targetPackages.serene_toolchain.llvm or self.serene_toolchain.llvm;
|
# targetLlvm = self.targetPackages.serene_toolchain.llvm or self.serene_toolchain.llvm;
|
||||||
monorepoSrc = super.fetchgit {
|
# monorepoSrc = super.fetchgit {
|
||||||
url = llvm.url;
|
# url = llvm.url;
|
||||||
rev = llvm.rev;
|
# rev = llvm.rev;
|
||||||
hash = llvm.hash;
|
# hash = llvm.hash;
|
||||||
};
|
# };
|
||||||
officialRelease = null;
|
# officialRelease = null;
|
||||||
gitRelease = {
|
# gitRelease = {
|
||||||
version = llvm.version;
|
# version = llvm.version;
|
||||||
rev = llvm.rev;
|
# rev = llvm.rev;
|
||||||
rev-version = llvm.rev-version;
|
# rev-version = llvm.rev-version;
|
||||||
};
|
# };
|
||||||
}));
|
# }));
|
||||||
})
|
# })
|
||||||
(final: prev: {
|
(final: prev: {
|
||||||
cpio = prev.cpio.overrideAttrs (old: {
|
p11-kit = prev.p11-kit.overrideAttrs (old: {
|
||||||
patches = [
|
patches = [
|
||||||
./patches/0001-configure-Include-needed-header-for-major-minor-macr.patch
|
./scripts/patches/p11-kit_skip_test.patch
|
||||||
];
|
];
|
||||||
|
});
|
||||||
|
|
||||||
|
cpio = prev.cpio.overrideAttrs (old: {
|
||||||
nativeBuildInputs = [ prev.autoreconfHook ];
|
nativeBuildInputs = [ prev.autoreconfHook ];
|
||||||
NIX_CFLAGS_COMPILE = "-Wno-implicit-function-declaration";
|
NIX_CFLAGS_COMPILE = "-Wno-implicit-function-declaration";
|
||||||
});
|
});
|
||||||
|
@ -62,17 +82,33 @@
|
||||||
|
|
||||||
# We don't need systemd at all
|
# We don't need systemd at all
|
||||||
util-linux = prev.util-linux.override { systemdSupport = false; };
|
util-linux = prev.util-linux.override { systemdSupport = false; };
|
||||||
|
|
||||||
|
# iwyu = (prev.include-what-you-use.overrideAttrs (old:
|
||||||
|
# let
|
||||||
|
# version = "0.20";
|
||||||
|
# in {
|
||||||
|
# inherit version;
|
||||||
|
|
||||||
|
# src = prev.fetchurl {
|
||||||
|
# url = "${old.meta.homepage}/downloads/${old.pname}-${version}.src.tar.gz";
|
||||||
|
# hash = "sha256-dfzh5khfKA+PE/TC0JCxHS/SECtQhXUHyEE6kZt6+Jk=";
|
||||||
|
# };
|
||||||
|
# cmakeFlags = [ "-DCMAKE_PREFIX_PATH=${prev.llvmPackages_16.llvm.dev}" ];
|
||||||
|
|
||||||
|
# })).override {
|
||||||
|
# llvmPackages = prev.__splicedPackages.llvmPackages_16;
|
||||||
|
# };
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
get_pkgs = system:
|
get_pkgs = system:
|
||||||
if system == "x86_64-linux"
|
if system == "x86_64-linux"
|
||||||
then import nixpkgs {
|
then import nixpkgs {
|
||||||
inherit system overlays;
|
inherit system overlays;
|
||||||
crossSystem = nixpkgs.lib.systems.examples.musl64 // { useLLVM = true; };
|
crossSystem = nixpkgs.lib.systems.examples.musl64 // { useLLVM = true; };
|
||||||
config.replaceCrossStdenv = { buildPackages, baseStdenv }:
|
config.replaceCrossStdenv = { buildPackages, baseStdenv }:
|
||||||
buildPackages.stdenvAdapters.overrideCC baseStdenv buildPackages.llvmPackages_16.clangUseLLVM;
|
buildPackages.stdenvAdapters.overrideCC baseStdenv buildPackages.llvmPackages_16.clangUseLLVM;
|
||||||
}
|
}
|
||||||
else import nixpkgs {
|
else import nixpkgs {
|
||||||
inherit system overlays;
|
inherit system overlays;
|
||||||
};
|
};
|
||||||
|
@ -80,57 +116,94 @@
|
||||||
|
|
||||||
pkgs = get_pkgs system;
|
pkgs = get_pkgs system;
|
||||||
|
|
||||||
|
sereneLLVM = pkgs.callPackage ./nix/llvm.nix {
|
||||||
|
inherit (pkgs) lib stdenv cmake ninja ccache zlib libxml2 fetchgit;
|
||||||
|
};
|
||||||
|
|
||||||
|
stdenv = pkgs.stdenvAdapters.overrideCC pkgs.stdenv sereneLLVM;
|
||||||
#with pkgs;
|
#with pkgs;
|
||||||
native_build_inputs =
|
native_build_inputs =
|
||||||
let
|
let
|
||||||
|
|
||||||
|
|
||||||
|
filterCmakeFlags = xs: builtins.filter
|
||||||
|
(x: !(x == "-DCMAKE_CROSSCOMPILING=True" || pkgs.lib.hasPrefix "-DLLVM_TABLEGEN=" x))
|
||||||
|
xs;
|
||||||
|
|
||||||
git' = pkgs.git.overrideAttrs (old: {
|
git' = pkgs.git.overrideAttrs (old: {
|
||||||
preInstallCheck =
|
preInstallCheck =
|
||||||
pkgs.lib.replaceStrings [ ''disable_test t0201-gettext-fallbacks'' ]
|
pkgs.lib.replaceStrings [ ''disable_test t0201-gettext-fallbacks'' ]
|
||||||
[ ''
|
[ ''
|
||||||
disable_test t0201-gettext-fallbacks
|
disable_test t0201-gettext-fallbacks
|
||||||
disable_test t2082-parallel-checkout-attributes
|
disable_test t2082-parallel-checkout-attributes
|
||||||
'' ]
|
'' ]
|
||||||
old.preInstallCheck;
|
old.preInstallCheck;
|
||||||
});
|
});
|
||||||
in with pkgs; [
|
# iwyu = (pkgs.include-what-you-use.overrideAttrs (old:
|
||||||
cmake
|
# let
|
||||||
ninja
|
# version = "0.20";
|
||||||
ccache
|
# in {
|
||||||
# serene_toolchain.lldb
|
# inherit version;
|
||||||
# serene_toolchain.lld
|
|
||||||
# serene_toolchain.libcxx
|
|
||||||
# serene_toolchain.libcxxabi
|
|
||||||
# serene_toolchain.compiler-rt
|
|
||||||
git'
|
|
||||||
zsh
|
|
||||||
python3
|
|
||||||
];
|
|
||||||
|
|
||||||
build_inputs = with pkgs; [
|
# src = pkgs.fetchurl {
|
||||||
|
# url = "${old.meta.homepage}/downloads/${old.pname}-${version}.src.tar.gz";
|
||||||
|
# hash = "sha256-dfzh5khfKA+PE/TC0JCxHS/SECtQhXUHyEE6kZt6+Jk=";
|
||||||
|
# };
|
||||||
|
|
||||||
|
|
||||||
|
# })).override {
|
||||||
|
# llvmPackages = pkgs.__splicedPackages.llvmPackages_16;# .overrideAttrs (oldLLVM: {
|
||||||
|
# # cmakeFlags = builtins.trace ">> ${toString(filterCmakeFlags oldLLVM.cmakeFlags)}" filterCmakeFlags oldLLVM.cmakeFlags;
|
||||||
|
# # });
|
||||||
|
# };
|
||||||
|
# mlir_16' = pkgs.mlir_16.overrideAttrs (old: {
|
||||||
|
|
||||||
|
# });
|
||||||
|
in builtins.trace ">> ${sereneLLVM}" (with pkgs; [
|
||||||
|
cmake
|
||||||
|
ninja
|
||||||
|
ccache
|
||||||
|
git'
|
||||||
|
zsh
|
||||||
|
zsh-autosuggestions
|
||||||
|
zsh-autocomplete
|
||||||
|
zsh-syntax-highlighting
|
||||||
|
python3
|
||||||
|
sereneLLVM
|
||||||
|
# iwyu
|
||||||
|
]);
|
||||||
|
|
||||||
|
build_inputs = with pkgs; [
|
||||||
boehmgc
|
boehmgc
|
||||||
# llvm_16
|
# llvm_16
|
||||||
|
# llvm_16
|
||||||
|
# mlir_16
|
||||||
|
|
||||||
gtest
|
gtest
|
||||||
gmock
|
gmock
|
||||||
# zlib-ng
|
# zlib-ng
|
||||||
# zstd
|
# zstd
|
||||||
include-what-you-use
|
|
||||||
];
|
];
|
||||||
|
|
||||||
in {
|
in {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = (pkgs.mkShell.override {inherit stdenv;}) {
|
||||||
nativeBuildInputs = native_build_inputs;
|
nativeBuildInputs = native_build_inputs;
|
||||||
buildInputs = build_inputs;
|
buildInputs = build_inputs;
|
||||||
shellHook = ''zsh --norcs && exit'';
|
shellHook =
|
||||||
};
|
''
|
||||||
|
ZDOTDIR=${zshDir} zsh -d && exit
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
packages.cmake = pkgs.cmake;
|
packages.cmake = pkgs.cmake;
|
||||||
packages.blah = pkgs.stdenv.mkDerivation {
|
packages.blah = pkgs.stdenv.mkDerivation {
|
||||||
pname = "blah";
|
pname = "blah";
|
||||||
version = "0.1";
|
version = "0.1";
|
||||||
nativeBuildInputs = native_build_inputs;
|
nativeBuildInputs = native_build_inputs;
|
||||||
buildInputs = build_inputs;
|
buildInputs = build_inputs;
|
||||||
};
|
};
|
||||||
}
|
packages.mlir = pkgs.mlir_16;
|
||||||
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,163 @@
|
||||||
|
# Serene Programming Language
|
||||||
|
#
|
||||||
|
# Copyright (c) 2019-2023 Sameer Rahmani <lxsameer@gnu.org>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, version 2.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
{ lib,
|
||||||
|
stdenv,
|
||||||
|
cmake,
|
||||||
|
ninja,
|
||||||
|
libxml2,
|
||||||
|
python3,
|
||||||
|
fetchgit,
|
||||||
|
zlib,
|
||||||
|
ccache ? null,
|
||||||
|
useCcache ? false,
|
||||||
|
url ? "https://github.com/llvm/llvm-project.git",
|
||||||
|
hash ? "sha256-8MEDLLhocshmxoEBRSKlJ/GzJ8nfuzQ8qn0X/vLA+ag=",
|
||||||
|
version ? "17.0.6",
|
||||||
|
ref ? "refs/tags/llvmorg-${version}"
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
ncpus = builtins.getEnv "NIX_BUILD_CORES";
|
||||||
|
in builtins.trace ">>> ${toString ncpus}" stdenv.mkDerivation rec {
|
||||||
|
inherit version;
|
||||||
|
pname = "serene_llvm";
|
||||||
|
|
||||||
|
src = fetchgit {
|
||||||
|
inherit url hash;
|
||||||
|
rev = ref;
|
||||||
|
};
|
||||||
|
|
||||||
|
sourceRoot = "${src.name}/llvm";
|
||||||
|
|
||||||
|
nativeBuildInputs = [ cmake ninja python3 zlib ];
|
||||||
|
buildInputs = [ libxml2 zlib ];
|
||||||
|
|
||||||
|
NIX_CFLAGS_COMPILE = ["-fno-rtti"];
|
||||||
|
#ninjaFlags = [ "-v" ];
|
||||||
|
cmakeFlags = [
|
||||||
|
# "-DLLVM_PARALLEL_COMPILE_JOBS=${ncpus}"
|
||||||
|
# "-DLLVM_PARALLEL_LINK_JOBS=1"
|
||||||
|
"-DLLVM_BUILD_EXAMPLES=ON"
|
||||||
|
"-DLLVM_TARGETS_TO_BUILD='X86'"
|
||||||
|
"-DCMAKE_BUILD_TYPE=Release"
|
||||||
|
"-DLLVM_ENABLE_ASSERTIONS=ON"
|
||||||
|
"-DLLVM_CCACHE_BUILD=OFF"
|
||||||
|
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
|
||||||
|
|
||||||
|
# No lldb? Yes, lldb links against liblldb.so and since we use
|
||||||
|
# -static with our executables that wouldn't be easy to handle
|
||||||
|
# and I'm lazy. We can just compile the lldb or any other debugger
|
||||||
|
# on the host
|
||||||
|
"-DLLVM_ENABLE_PROJECTS='clang;lld;mlir;clang-tools-extra'"
|
||||||
|
"-DLLVM_RUNTIME_TARGETS='compiler-rt;libcxx;libcxxabi;libunwind'"
|
||||||
|
"-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}"
|
||||||
|
"-DLLVM_RUNTIME_TARGET=${stdenv.hostPlatform.config}"
|
||||||
|
# Serene uses static libs, so no shared lib
|
||||||
|
"-DLLVM_ENABLE_PIC=OFF"
|
||||||
|
#"-DLLVM_BUILD_STATIC=ON"
|
||||||
|
"-DLLVM_LINK_LLVM_DYLIB=off"
|
||||||
|
|
||||||
|
"-DLLVM_ENABLE_LIBXML2=OFF"
|
||||||
|
"-DLLVM_BUILD_DOCS=OFF"
|
||||||
|
"-DLLVM_ENABLE_SPHINX=OFF"
|
||||||
|
"-DSPHINX_OUTPUT_MAN=OFF"
|
||||||
|
"-DSPHINX_OUTPUT_HTML=OFF"
|
||||||
|
|
||||||
|
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
|
||||||
|
"-DCLANG_DEFAULT_CXX_STDLIB=libc++"
|
||||||
|
"-DCLANG_DEFAULT_LINKER=lld"
|
||||||
|
"-DCLANG_DEFAULT_OBJCOPY=llvm-objcopy"
|
||||||
|
"-DCLANG_DEFAULT_RTLIB=compiler-rt"
|
||||||
|
"-DCLANG_VENDOR_UTI=serene.toolchain"
|
||||||
|
"-DLLVM_ENABLE_LIBCXX=ON"
|
||||||
|
|
||||||
|
"-DLLVM_ENABLE_NEW_PASS_MANAGER=ON"
|
||||||
|
"-DLLVM_BUILD_TESTS=OFF"
|
||||||
|
"-DLLVM_ENABLE_ASSERTIONS=ON"
|
||||||
|
"-DLLVM_ENABLE_LIBXML2=OFF"
|
||||||
|
"-DLLVM_ENABLE_TERMINFO=OFF"
|
||||||
|
#"-DLLVM_ENABLE_ZLIB=FORCE_ON"
|
||||||
|
"-DLLVM_INCLUDE_BENCHMARKS=OFF"
|
||||||
|
"-DLLVM_INCLUDE_EXAMPLES=OFF"
|
||||||
|
"-DLLVM_INCLUDE_TESTS=OFF"
|
||||||
|
"-DLLVM_INCLUDE_GO_TESTS=OFF"
|
||||||
|
"-DLLVM_ENABLE_BINDINGS=OFF"
|
||||||
|
#"-DLLVM_TARGETS_TO_BUILD": "X86;AArch64;AMDGPU;ARM;RISCV;WebAssembly"
|
||||||
|
"-DLLVM_STATIC_LINK_CXX_STDLIB=ON"
|
||||||
|
"-DPACKAGE_VENDOR=Serene"
|
||||||
|
"-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON"
|
||||||
|
"-DENABLE_X86_RELAX_RELOCATIONS=ON"
|
||||||
|
"-DBUILD_SHARED_LIBS=OFF"
|
||||||
|
"-DCLANG_ENABLE_BOOTSTRAP=ON"
|
||||||
|
"-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON"
|
||||||
|
"-DLIBCXXABI_ENABLE_SHARED=OFF"
|
||||||
|
"-DLIBCXX_ABI_VERSION=2"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
"-DLIBCLANG_BUILD_STATIC=ON"
|
||||||
|
|
||||||
|
"-DCMAKE_INSTALL_PREFIX=${placeholder "out"}"
|
||||||
|
"-DCMAKE_INSTALL_BINDIR=${placeholder "out"}/bin"
|
||||||
|
"-DCMAKE_INSTALL_INCLUDEDIR=${placeholder "out"}/include"
|
||||||
|
"-DCMAKE_INSTALL_LIBDIR=${placeholder "out"}/lib"
|
||||||
|
"-DCMAKE_INSTALL_LIBEXECDIR=${placeholder "out"}/libexec"
|
||||||
|
] ++ lib.optional stdenv.hostPlatform.isMusl [
|
||||||
|
"-DDLIBCXX_HAS_MUSL_LIBC=ON"
|
||||||
|
] ++ lib.optional stdenv.hostPlatform.isStatic [
|
||||||
|
"-DLIBCLANG_BUILD_STATIC=ON"
|
||||||
|
] ++ lib.optional useCcache [
|
||||||
|
"-DLLVM_CCACHE_BUILD=ON"
|
||||||
|
];
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
homepage = "https://llvm.org/";
|
||||||
|
description = "A collection of modular and reusable compiler and toolchain technologies";
|
||||||
|
longDescription = ''
|
||||||
|
The LLVM Project is a collection of modular and reusable compiler and
|
||||||
|
toolchain technologies. Despite its name, LLVM has little to do with
|
||||||
|
traditional virtual machines. The name "LLVM" itself is not an acronym; it
|
||||||
|
is the full name of the project.
|
||||||
|
LLVM began as a research project at the University of Illinois, with the
|
||||||
|
goal of providing a modern, SSA-based compilation strategy capable of
|
||||||
|
supporting both static and dynamic compilation of arbitrary programming
|
||||||
|
languages. Since then, LLVM has grown to be an umbrella project consisting
|
||||||
|
of a number of subprojects, many of which are being used in production by
|
||||||
|
a wide variety of commercial and open source projects as well as being
|
||||||
|
widely used in academic research. Code in the LLVM project is licensed
|
||||||
|
under the "Apache 2.0 License with LLVM exceptions".
|
||||||
|
'';
|
||||||
|
license = lib.licenses.ncsa;
|
||||||
|
|
||||||
|
# TODO: Add the maintainer
|
||||||
|
# maintainers = "Sameer Rahmani []";
|
||||||
|
|
||||||
|
# See llvm/cmake/config-ix.cmake.
|
||||||
|
platforms =
|
||||||
|
lib.platforms.aarch64 ++
|
||||||
|
lib.platforms.arm ++
|
||||||
|
lib.platforms.mips ++
|
||||||
|
lib.platforms.power ++
|
||||||
|
lib.platforms.s390x ++
|
||||||
|
lib.platforms.wasi ++
|
||||||
|
lib.platforms.x86 ++
|
||||||
|
lib.platforms.riscv ++
|
||||||
|
lib.platforms.m68k;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
# -DCMAKE_C_COMPILER=clang \ # If you have clang installed already
|
||||||
|
# -DCMAKE_CXX_COMPILER=clang++ \ # If you have clang installed already
|
||||||
|
# -DLLVM_ENABLE_LLD=ON
|
|
@ -0,0 +1,19 @@
|
||||||
|
# Serene Programming Language
|
||||||
|
#
|
||||||
|
# Copyright (c) 2019-2023 Sameer Rahmani <lxsameer@gnu.org>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, version 2.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
{ lib }:
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
From 132b779414c2236c1350b578b59c8edcfc4c5a14 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Sameer Rahmani <lxsameer@gnu.org>
|
||||||
|
Date: Sat, 25 Nov 2023 13:14:42 +0000
|
||||||
|
Subject: [PATCH] test
|
||||||
|
|
||||||
|
---
|
||||||
|
common/test.c | 5 +++--
|
||||||
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/common/test.c b/common/test.c
|
||||||
|
index 6cdbd1fa2118..6cd6f84bcdc7 100644
|
||||||
|
--- a/common/test.c
|
||||||
|
+++ b/common/test.c
|
||||||
|
@@ -614,8 +614,9 @@ p11_test_copy_setgid (const char *input,
|
||||||
|
assert (fd >= 0);
|
||||||
|
|
||||||
|
copy_file (input, fd);
|
||||||
|
- if (fchown (fd, getuid (), group) < 0)
|
||||||
|
- assert_not_reached ();
|
||||||
|
+ if (fchown (fd, getuid (), group) < 0) {
|
||||||
|
+ return NULL;
|
||||||
|
+ }
|
||||||
|
if (fchmod (fd, 02750) < 0)
|
||||||
|
assert_not_reached ();
|
||||||
|
if (close (fd) < 0)
|
||||||
|
--
|
||||||
|
2.41.0
|
|
@ -0,0 +1,72 @@
|
||||||
|
#! /bin/zsh
|
||||||
|
# shellcheck disable=all
|
||||||
|
# Serene Programming Language
|
||||||
|
#
|
||||||
|
# Copyright (c) 2019-2023 Sameer Rahmani <lxsameer@gnu.org>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, version 2.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
mkdir -p "$HOME/.config/serene/"
|
||||||
|
|
||||||
|
export HISTFILE="$HOME/.config/serene/.zsh_history"
|
||||||
|
export HISTFILESIZE=500
|
||||||
|
export SAVEHIST=500
|
||||||
|
export HISTSIZE=500
|
||||||
|
|
||||||
|
setopt HIST_IGNORE_DUPS
|
||||||
|
setopt NO_HIST_BEEP
|
||||||
|
setopt PROMPT_SUBST
|
||||||
|
setopt NO_BEEP
|
||||||
|
setopt AUTO_CD
|
||||||
|
setopt CORRECT
|
||||||
|
setopt SHARE_HISTORY
|
||||||
|
setopt HIST_IGNORE_ALL_DUPS
|
||||||
|
|
||||||
|
function user_prompt () {
|
||||||
|
if [ $UID != 0 ]; then
|
||||||
|
echo "%F{028}%F{002}> "
|
||||||
|
else
|
||||||
|
echo "%F{001}# "
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
autoload -U colors && colors
|
||||||
|
autoload -Uz compinit
|
||||||
|
compinit
|
||||||
|
|
||||||
|
# zstyle ':completion:*' auto-description 'specify: %d'
|
||||||
|
# zstyle ':completion:*' completer _expand _complete _correct _approximate
|
||||||
|
# zstyle ':completion:*' format 'Completing %d'
|
||||||
|
# zstyle ':completion:*' group-name ''
|
||||||
|
# if [ "$(uname 2> /dev/null)" = "Linux" ]; then
|
||||||
|
# zstyle ':completion:*' menu select=2 eval "$(dircolors -b)"
|
||||||
|
# fi
|
||||||
|
# zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
|
||||||
|
# zstyle ':completion:*' list-colors ''
|
||||||
|
# zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
|
||||||
|
# zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
|
||||||
|
# zstyle ':completion:*' menu select=long
|
||||||
|
# zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
|
||||||
|
# zstyle ':completion:*' use-compctl false
|
||||||
|
# zstyle ':completion:*' verbose true
|
||||||
|
|
||||||
|
# zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
|
||||||
|
# zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
|
||||||
|
|
||||||
|
echo "Welcome to serene's development environment"
|
||||||
|
|
||||||
|
PROMPT='
|
||||||
|
%F{015}[%F{099}SERENE%F{015}][%F{198}$(git branch --show-current)%F{015}]
|
||||||
|
%F{005}%~%F{003} $(user_prompt)%f'
|
||||||
|
|
||||||
|
export PROMPT
|
Loading…
Reference in New Issue