Skip to content

Commit

Permalink
chore: repo cleanup (#100)
Browse files Browse the repository at this point in the history
* chore: update mode to 644 for *.py files

* chore: update mode to 644 for some regular files

* chore: move shell script fix files

* tools: add subdirectory check for shell script fix files

* fix: use xrandr binary from debian 11

- We need to use the appropriate binaries the aligns with the container framework for them to reliably work. In the future, however, we should ideally build them from source instead of adding binaries to the repo.

- Source of the .deb package: https://packages.debian.org/bullseye/amd64/x11-xserver-utils/download

* build: init build system

- Removes the xrandr binary and its corresponding archive in favor of building it from source. xrandr and future binaries will be expected to be built within the steam runtime

* chore: remove unused files

- cabextract and libmspack.so are covered by Proton, and are available in the container via LD_LIBRARY_PATH.

* chore: remove .travis.yml

* build: add libmspack to subprojects

* Makefile: build cabextract

* Makefile: build libmspack

* Makefile: update xrandr install

* Makefile: update targets

* Makefile: create INSTALL_DIR

* workflows: build protonfixes

* Makefile: fix build error

Co-authored-by: Stelios Tsampas <[email protected]>

---------

Co-authored-by: Stelios Tsampas <[email protected]>
  • Loading branch information
R1kaB3rN and loathingKernel authored Aug 31, 2024
1 parent 0d33bbe commit bfc8a9b
Show file tree
Hide file tree
Showing 27 changed files with 159 additions and 10 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/make.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: make

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
# The Steam Runtime platform (sniper) uses Python 3.9
python-version: "3.9"
- name: Install dependencies
run: |
sudo apt-get install podman
- name: Initialize submodules
run: |
git submodule update --init --recursive
- name: Build protonfixes in Steam Runtime
run: |
podman run --rm -v $(pwd):/workspace -w /workspace registry.gitlab.steamos.cloud/steamrt/sniper/sdk /bin/sh -c "make install"
Empty file modified .gitignore
100755 → 100644
Empty file.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "subprojects/x11-xserver-utils"]
path = subprojects/x11-xserver-utils
url = https://salsa.debian.org/xorg-team/app/x11-xserver-utils.git
[submodule "subprojects/libmspack"]
path = subprojects/libmspack
url = https://github.com/kyz/libmspack.git
6 changes: 0 additions & 6 deletions .travis.yml

This file was deleted.

Empty file modified LICENSE
100755 → 100644
Empty file.
103 changes: 103 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
OBJDIR := builddir

PREFIX ?= /usr
DESTDIR ?=
INSTALL_DIR ?= $(shell pwd)/dist/protonfixes

.PHONY: all

all: xrandr-dist cabextract-dist libmspack-dist

.PHONY: install

install: protonfixes-install xrandr-install cabextract-install libmspack-install

#
# protonfixes
#

.PHONY: protonfixes

protonfixes-install: protonfixes
$(info :: Installing protonfixes )
install -d $(INSTALL_DIR)
cp -r gamefixes-* $(INSTALL_DIR)
cp -r verbs $(INSTALL_DIR)
cp *.py $(INSTALL_DIR)
cp winetricks $(INSTALL_DIR)
rm $(INSTALL_DIR)/protonfixes_test.py

#
# xrandr
#

$(OBJDIR)/.build-xrandr-dist: | $(OBJDIR)
$(info :: Building xrandr )
cd subprojects/x11-xserver-utils/xrandr && \
./configure --prefix=/usr && \
make
touch $(@)

.PHONY: xrandr-dist

xrandr-dist: $(OBJDIR)/.build-xrandr-dist

xrandr-install: xrandr-dist
$(info :: Installing xrandr )
# Install
cd subprojects/x11-xserver-utils/xrandr && \
make DESTDIR=$(INSTALL_DIR) install
# Post install
cp $(INSTALL_DIR)/usr/bin/xrandr $(INSTALL_DIR)
rm -r $(INSTALL_DIR)/usr

#
# cabextract
#

$(OBJDIR)/.build-cabextract-dist: | $(OBJDIR)
$(info :: Building cabextract )
cd subprojects/libmspack/cabextract && \
./autogen.sh && \
./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man && \
make
touch $(@)

.PHONY: cabextract-dist

cabextract-dist: $(OBJDIR)/.build-cabextract-dist

cabextract-install: cabextract-dist
$(info :: Installing cabextract )
cd subprojects/libmspack/cabextract && \
make DESTDIR=$(INSTALL_DIR) install
cp $(INSTALL_DIR)/usr/bin/cabextract $(INSTALL_DIR)
rm -r $(INSTALL_DIR)/usr

#
# libmspack
#

$(OBJDIR)/.build-libmspack-dist: | $(OBJDIR)
$(info :: Building libmspack )
cd subprojects/libmspack/libmspack && \
autoreconf -vfi && \
./configure --prefix=/usr --disable-static --sysconfdir=/etc --localstatedir=/var && \
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool && \
make
touch $(@)

.PHONY: libmspack-dist

libmspack-dist: $(OBJDIR)/.build-libmspack-dist

libmspack-install: libmspack-dist
$(info :: Installing libmspack )
cd subprojects/libmspack/libmspack && \
make DESTDIR=$(INSTALL_DIR) install
cp -d $(INSTALL_DIR)/usr/lib/libmspack* $(INSTALL_DIR)
rm -r $(INSTALL_DIR)/usr
rm $(INSTALL_DIR)/libmspack.la

$(OBJDIR):
@mkdir -p $(@)
Empty file modified __init__.py
100755 → 100644
Empty file.
Binary file removed cabextract
Binary file not shown.
Binary file removed cabextract_1.9-1.debian.tar.xz
Binary file not shown.
Empty file modified checks.py
100755 → 100644
Empty file.
Empty file modified config.py
100755 → 100644
Empty file.
Empty file modified debug.py
100755 → 100644
Empty file.
Empty file modified download.py
100755 → 100644
Empty file.
Empty file modified engine.py
100755 → 100644
Empty file.
Empty file modified fix.py
100755 → 100644
Empty file.
1 change: 0 additions & 1 deletion libmspack.so.0

This file was deleted.

Binary file removed libmspack.so.0.1.0
Binary file not shown.
Binary file removed libmspack_0.10.1-1.debian.tar.xz
Binary file not shown.
Empty file modified logger.py
100755 → 100644
Empty file.
1 change: 1 addition & 0 deletions subprojects/libmspack
Submodule libmspack added at 305907
1 change: 1 addition & 0 deletions subprojects/x11-xserver-utils
Submodule x11-xserver-utils added at a3ecab
8 changes: 8 additions & 0 deletions symlinkfix.sh → tools/symlinkfix.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/bin/bash

if [[ $(basename "$PWD") != "tools" ]]; then
echo "Not executing within subdirectory 'tools', exiting"
exit 1
fi

cd ..

# change symlink targets to lower case if they aren't already
find . -type l | while read symlink; do
target=$(readlink "$symlink")
Expand Down
10 changes: 10 additions & 0 deletions tools/vcrunfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

if [[ $(basename "$PWD") != "tools" ]]; then
echo "Not executing within subdirectory 'tools', exiting"
exit 1
fi

cd ..

find ./ \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i 's/vcrun2019/vcrun2019/g'
Empty file modified util.py
100755 → 100644
Empty file.
3 changes: 0 additions & 3 deletions vcrunfix

This file was deleted.

Binary file removed x11-xserver-utils_7.7+10.tar.xz
Binary file not shown.
Binary file removed xrandr
Binary file not shown.

0 comments on commit bfc8a9b

Please sign in to comment.