Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: simplify build / reproducable builds using nix flake #271

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add flake to virtualsmartcard for reproducable builds
  • Loading branch information
HannesGitH committed Apr 16, 2024
commit ff21de4c6846ed5929db7739539ed2f5352857db
16 changes: 8 additions & 8 deletions virtualsmartcard/configure.ac
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.64])
AC_INIT([Virtual Smart Card], [0.10], [https://github.com/frankmorgner/vsmartcard/issues], [virtualsmartcard], [http:https://frankmorgner.github.io/vsmartcard/virtualsmartcard/README.html])
AC_PREREQ([2.72])
AC_INIT([Virtual Smart Card],[0.10],[https://github.com/frankmorgner/vsmartcard/issues],[virtualsmartcard],[http:https://frankmorgner.github.io/vsmartcard/virtualsmartcard/README.html])
AC_CONFIG_SRCDIR([src/vpcd/vpcd.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
Expand Down Expand Up @@ -70,12 +70,12 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

# --enable-infoplist
AC_ARG_ENABLE(infoplist,
AC_HELP_STRING([--enable-infoplist],[Builds Info.plist for OSX @<:@default=no@:>@]),
AS_HELP_STRING([--enable-infoplist],[Builds Info.plist for OSX @<:@default=no@:>@]),
[infoplist="yes"], [infoplist=no])

# --enable-libpcsclite
AC_ARG_ENABLE(libpcsclite,
AC_HELP_STRING([--enable-libpcsclite],[Build a lightweight version of
AS_HELP_STRING([--enable-libpcsclite],[Build a lightweight version of
libpcsclite, conflicts with PCSC-Lite @<:@default=no@:>@]),
[libpcsclite="${enableval}"], [libpcsclite=no])
if test "${libpcsclite}" = no ; then
Expand All @@ -102,7 +102,7 @@ if test "${libpcsclite}" = no ; then

# --enable-serialdropdir=DIR
AC_ARG_ENABLE(serialdropdir,
AC_HELP_STRING([--enable-serialdropdir=DIR],[directory to install the
AS_HELP_STRING([--enable-serialdropdir=DIR],[directory to install the
serial wrapper driver (default to pcscd config or $(prefix)/pcsc/drivers/serial)]),
[serialdropdir="${enableval}"], [serialdropdir=no])
if test "${serialdropdir}" = no ; then
Expand Down Expand Up @@ -148,7 +148,7 @@ if test "${libpcsclite}" = no ; then

# --enable-serialconfdir=DIR
AC_ARG_ENABLE(serialconfdir,
AC_HELP_STRING([--enable-serialconfdir=DIR],[directory to install the
AS_HELP_STRING([--enable-serialconfdir=DIR],[directory to install the
serial wrapper driver (default to pcscd config or /etc/reader.conf.d)]),
[serialconfdir="${enableval}"], [serialconfdir=no])
if test "${serialconfdir}" = no ; then
Expand Down Expand Up @@ -202,7 +202,7 @@ fi

# --enable-vpcdhost
AC_ARG_ENABLE(vpcdhost,
AC_HELP_STRING([--enable-vpcdhost=ADDRESS],[Default address to connect to when
AS_HELP_STRING([--enable-vpcdhost=ADDRESS],[Default address to connect to when
communicating with vicc. Use "/dev/null" if vpcd shall open
the socket and wait for an incoming connection.
@<:@default=/dev/null@:>@]),
Expand All @@ -217,7 +217,7 @@ fi

# --enable-vpcdslots
AC_ARG_ENABLE(vpcdslots,
AC_HELP_STRING([--enable-vpcdslots=COUNT],[Default number of slots to open.
AS_HELP_STRING([--enable-vpcdslots=COUNT],[Default number of slots to open.
vpcd will open one socket for each slot incrementing the
port number each time. @<:@default=2@:>@]),
[vpcdslots="${enableval}"], [vpcdslots=2])
Expand Down
40 changes: 40 additions & 0 deletions virtualsmartcard/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
description = "vicc emulates a smart card and makes it accessible through PC/SC";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.11";
};

outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
with flake-utils.lib; eachSystem allSystems (system:
let
pkgs = import nixpkgs { inherit system; };
pkgs-stable = import inputs.nixpkgs-stable { inherit system; };
in rec {
packages = rec {

vicc = pkgs.stdenv.mkDerivation {
name = "parse-ts";
src = self;
buildInputs = with pkgs; [ autoconf automake libtool pkg-config help2man pcsclite ];
buildPhase = ''
autoreconf -vfi
./configure --prefix=$out
make
'';
installPhase = ''
make install
'';
};

};

shell = pkgs.mkShell {
buildInputs = with pkgs; [ autoconf automake libtool pkg-config help2man pcsclite ];
};

defaultPackage = packages.vicc;
});
}