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

add PCSC support to libnfc #62

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions docs/developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Most applications use a lot of MiSTer-specific paths and files to function. They

- [Docker](https://www.docker.com/)

Used for building all the MiSTer binaries. You also need to configure cross-compilation in Docker since ARM images are used for the build process. Podman should also work, but the build scripts use Docker explicitly.
Used for building all the MiSTer binaries. You also need to [configure cross-compilation in Docker](https://docs.docker.com/build/building/multi-platform/#building-multi-platform-images) since ARM images are used for the build process. Podman should also work, but the build scripts use Docker explicitly.

On Linux, enable cross-platform builds with something like this: `apt install qemu binfmt-support qemu-user-static`

Expand All @@ -48,7 +48,7 @@ To start, you can run `go mod download` from the root of the project folder. Thi

All build steps are done with the `mage` command run from the root of the project folder. Run `mage` by itself to see a list of available commands.

Before building MiSTer binaries, you'll also need to build the Docker image it uses. Just run `mage makeArmImage` to add it to your system.
Before building MiSTer binaries, you'll also need to build the Docker image it uses. Just run `mage makeMisterImage` to add it to your system.

Built binaries will be created in the `bin` directory under its appropriate architecture subdirectory.

Expand Down
2 changes: 1 addition & 1 deletion magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var apps = []app{
path: filepath.Join(cwd, "cmd", "nfc"),
bin: "tapto.sh",
releaseId: "mrext/tapto",
ldFlags: "-lnfc -lusb -lcurses",
ldFlags: "-lpcsclite -lnfc -lusb -lcurses",
releaseFiles: []string{filepath.Join(cwd, "scripts", "nfcui", "nfcui.sh")},
},
}
Expand Down
24 changes: 12 additions & 12 deletions scripts/misterbuild/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,10 @@ RUN apt-get install -y ca-certificates openssl && \
RUN apt-get install build-essential git curl wget ncurses-dev -y && \
apt-get install golang-doc/bullseye-backports golang-go/bullseye-backports golang-src/bullseye-backports golang/bullseye-backports -y

# install libnfc dependencies
RUN apt-get install -y libusb-dev libtool autoconf automake
# install custom version of libnfc
RUN mkdir /internal && cd /internal && \
git clone --depth 1 https://github.com/sam1902/libnfc && \
cd libnfc && \
autoreconf -vis && \
./configure && \
make -j "$(nproc)" && \
make install

# install pcsc-lite and ccid dependencies
RUN apt-get install -y flex libusb-1.0-0-dev zlib1g-dev
# install custom version of pcsc-lite
RUN cd /internal && \
RUN mkdir /internal && cd /internal && \
wget https://pcsclite.apdu.fr/files/pcsc-lite-2.0.0.tar.bz2 && \
tar xf pcsc-lite-2.0.0.tar.bz2 && \
cd pcsc-lite-2.0.0 && \
Expand All @@ -43,6 +32,17 @@ RUN cd /internal && \
make -j "$(nproc)" && \
make install

# install libnfc dependencies
RUN apt-get install -y libusb-dev libtool autoconf automake
# install custom version of libnfc
RUN cd /internal && \
git clone --depth 1 https://github.com/sam1902/libnfc && \
cd libnfc && \
autoreconf -vis && \
./configure --with-drivers=all && \
make -j "$(nproc)" && \
make install

# drop permissions on output files
RUN useradd -m -u 1000 build
USER build
Expand Down