Commit 72b9b7ad authored by Vitaly Lipatov's avatar Vitaly Lipatov

just import winetricks-20210815.tar with rpmgs script

parent 7fd194eb
on: [push, pull_request]
jobs:
macos:
name: make install (with prefix)
runs-on: macos-latest
steps:
- name: checkout project
uses: actions/checkout@v2
# OSX doesn't allow writing to /usr/bin, so skip the non-PREFIX check
- name: run make install (with PREFIX)
run: time make install PREFIX="$(mktemp -d)"
linux:
name: make install (with prefix)
runs-on: ubuntu-latest
steps:
- name: checkout project
uses: actions/checkout@v2
- name: run make install (with PREFIX)
run: time make install PREFIX="$(mktemp -d)"
- name: run make install (without PREFIX)
run: time sudo make install
on: [push, pull_request]
jobs:
shellcheck:
name: shellcheck
runs-on: ubuntu-latest
steps:
- name: checkout project
uses: actions/checkout@v2
- name: run shell-checks
run: sudo apt-get -y install shellcheck python3-bashate && time ./tests/shell-checks
on: [push, pull_request]
jobs:
update:
name: self-update-test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- name: checkout project
uses: actions/checkout@v2
- name: run self-update-test
run: ./tests/self-update-test
language: shell
os:
- linux
- osx
arch:
- amd64
- ppc64le
sudo: required
dist: bionic
# Note: needed by winetricks-test, which not yet supported in TravisCI
# - cabextract
# - p7zip
# - unrar
# - unzip
# - wine
addons:
apt:
packages:
# for bashate
- python-tz
# for checkbashisms
- devscripts
# Ubuntu notes:
# * ShellCheck is already installed in TravisCI (but not on ppc64le, see below)
# * bashate is not available on Trusty and we need to install it manually
# macOS note:
# * Homebrew doesn't provide bashate, they don't package things
# that are on pypi
#
# We use a script that installs bashate by unpacking .deb files built for
# Ubuntu Bionic (18.04) because:
# 1. python-bashate 0.3.1-2 (for Artful) can be installed but
# Artful will not be supported after July 2018
# 2. python-bashate 0.5.1-1 (for Bionic) can't be installed on Trusty
# because it contains "control.tar.xz"
# > dpkg-deb: error: archive '/var/cache/apt/archives/python-bashate_0.5.1-1_all.deb' has premature member 'control.tar.xz' before 'control.tar.gz', giving up
# > dpkg: error processing archive /var/cache/apt/archives/python-bashate_0.5.1-1_all.deb (--unpack):
# > subprocess dpkg-deb --control returned error exit status 2
# 3. Adding apt-line for newer Ubuntu release breaks dependencies
# e.g. can't install Official Wine package on Ubuntu
# > The following packages have unmet dependencies:
# > winehq-stable : Depends: wine-stable (= 3.0.0~trusty)
# > E: Unable to correct problems, you have held broken packages.
# 4. Ubuntu Bionic is an LTS release and will be supported until April 2023
# This means that we can use version 0.5.1-1 until April 2023
# 5. The installation via the script is quick
# (simply download and unpack files)
#
# If the script fails, install pip and use it to install bashate
before_install:
- time sh ./misc/travis-install-bashate-deb.sh || time sh ./misc/travis-install-bashate-pip.sh
# "brew update" (or auto-update when installing) takes a long time,
# but checkbashisms and shellcheck can (usually) be installed without this
# So try installing with "HOMEBREW_NO_AUTO_UPDATE=1", which considerably reduces job time on macOS
# If it fails retry each individually with auto-update enabled
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
for pkg in checkbashisms shellcheck yq; do
if HOMEBREW_NO_AUTO_UPDATE=1 brew install "$pkg"; then
# everything worked, nothing more to do:
:
else
# Allow failure, since homebrew can be flaky (the tests will still run on linux).
time brew install "$pkg" || true
fi
done
fi
# Install shellcheck for power job
- |
if [[ "$TRAVIS_CPU_ARCH" == "ppc64le" ]]; then
time sudo apt update;
time sudo apt install -y shellcheck;
fi
# Note if testing on a branch, you can replace this with your desired command, e.g.,:
# script: time sh ./src/winetricks -q comctl32
# Some tests require a working $DISPLAY, and not just Xvfb. See tests/winetricks-test for the list.
# Either skip those / test manually, or run them on OS X.
# Also note:
# Installing wine on the vms is a pain.
# Linux: currently can't get 1.8.x / 1.9.x installed :/
# OS X: 38 minutes
script:
# shell-checks is quick and works, no display or compiles needed
- time sh ./tests/shell-checks
# Keep updates working
- time sh ./tests/self-update-test
# OS X doesn't allow writing to /usr/bin, skip non-PREFIX make install test there
install:
- if [[ "$TRAVIS_OS_NAME" != "osx" ]] ; then time sudo make install ; fi
- time make install PREFIX="$(mktemp -d)"
......@@ -83,8 +83,8 @@ check:
echo 'To suppress tests in debuild, export DEB_BUILD_OPTIONS=nocheck'
echo ''
echo 'FIXME: this should kill stray wine processes before and after, but some leak through, you might need to kill them.'
# Check for checkbashisms/shellcheck issues first:
echo "Running checkbashisms/shellcheck:"
# Check for shellcheck issues first:
echo "Running shellcheck:"
sh ./tests/shell-checks || exit 1
# Check all script dependencies before starting tests:
echo "Checking dependencies.."
......@@ -97,7 +97,7 @@ check-coverage:
WINETRICKS_ENABLE_KCOV=1 $(MAKE) check
shell-checks:
echo "This runs shell checks only. Currently, these are checkbashisms and shellcheck."
echo "This runs shell checks only. Currently, this is mostly shellcheck."
echo "This is relatively fast and doesn't download anything."
sh ./tests/shell-checks || exit 1
......@@ -122,8 +122,8 @@ test:
echo 'To suppress tests in debuild, export DEB_BUILD_OPTIONS=nocheck'
echo ''
echo 'FIXME: this should kill stray wine processes before and after, but some leak through, you might need to kill them.'
# Check for checkbashisms/shellcheck issues first:
echo "Running checkbashisms/shellcheck:"
# Check for shellcheck issues first:
echo "Running shellcheck:"
sh ./tests/shell-checks || exit 1
# Check all script dependencies before starting tests:
echo "Checking dependencies.."
......
# Winetricks
[![Build Status](https://travis-ci.org/Winetricks/winetricks.svg?branch=master)](https://travis-ci.org/Winetricks/winetricks) [![License](http://img.shields.io/:license-lgpl-green.svg)](https://tldrlegal.com/license/gnu-lesser-general-public-license-v2.1-(lgpl-2.1))
[![License](http://img.shields.io/:license-lgpl-green.svg)](https://tldrlegal.com/license/gnu-lesser-general-public-license-v2.1-(lgpl-2.1))
Homepage of Winetricks, previously hosted at <https://code.google.com/p/winetricks>.
......@@ -78,6 +78,13 @@ wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetric
# Move the winetricks BASH completion script to a standard location for BASH completion modules. See:
# https://www.tldp.org/LDP/abs/html/tabexpansion.html
sudo mv winetricks.bash-completion /usr/share/bash-completion/completions/winetricks
# Download the latest winetricks MAN page (master="latest version") from Github.
wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks.1
# Move the winetricks MAN page to a standard location for MAN pages. See:
# https://www.pathname.com/fhs/pub/fhs-2.3.html#USRSHAREMANMANUALPAGES
sudo mv winetricks.1 /usr/share/man/man1/winetricks.1
_EOF_SCRIPT
###### create update_winetricks FINISH ########
......@@ -199,7 +206,7 @@ load_icecat()
Note that the file prefix (icecat.verb) and command name (icecat) must match. All metadata fields are optional, only the command name and category are required.
# Tests
The tests need `bashate`, `checkbashisms`, and `shellcheck>=0.4.4` installed.
The tests need `bashate` and `shellcheck>=0.4.4` installed.
Makefile supports a few test targets:
* `check` - runs './tests/winetricks-tests quick' (without first clearing $WINETRICKS_CACHE)
......
#!/bin/sh
#
# This script is public domain.
# This script installs bashate by unpacking .deb files built for Ubuntu 18.04.
# This is intended to install/use bashate in TravisCI.
# Usage (.travis.yml):
# ...
# os:
# - linux
# - ...
# sudo: required
# dist: trusty
# ...
# addons:
# apt:
# packages:
# - python-tz
# - ...
# ...
# before_install:
# - time sh ./misc/travis-install-bashate-deb.sh
# - ...
set -eux
# "us-central1.gce.archive.ubuntu.com" is used by "apt" addon
# (See "Installing APT Packages" in logs), assuming it's fast
UBUNTU_POOL=http://us-central1.gce.archive.ubuntu.com/ubuntu/pool
DEB_BABEL_LOCALEDATA=${UBUNTU_POOL}/main/p/python-babel/python-babel-localedata_2.4.0+dfsg.1-2ubuntu1_all.deb
DEB_BABEL=${UBUNTU_POOL}/main/p/python-babel/python-babel_2.4.0+dfsg.1-2ubuntu1_all.deb
DEB_BASHATE=${UBUNTU_POOL}/universe/p/python-bashate/python-bashate_0.5.1-1_all.deb
DEB_PBR=${UBUNTU_POOL}/main/p/python-pbr/python-pbr_3.1.1-3ubuntu3_all.deb
DEB_SIX=${UBUNTU_POOL}/main/s/six/python-six_1.11.0-2_all.deb
if command -v bashate >/dev/null; then
echo "bashate is already installed."
exit 1
fi
if test -d /Library; then
# macOS: "six" is already installed
curl --remote-name-all ${DEB_BABEL_LOCALEDATA} ${DEB_BABEL} ${DEB_BASHATE} ${DEB_PBR}
BINDIR=/usr/local/bin
PACKAGESDIR=/Library/Python/2.7/site-packages
else
# Ubuntu
curl --remote-name-all ${DEB_BABEL_LOCALEDATA} ${DEB_BABEL} ${DEB_BASHATE} ${DEB_PBR} ${DEB_SIX}
BINDIR=/usr/bin
PACKAGESDIR=/usr/lib/python2.7/dist-packages
fi
for f in *.deb; do
ar p "${f}" data.tar.xz | tar -Jvxf -
done
sudo cp -R usr/lib/python2.7/dist-packages/* ${PACKAGESDIR}/
sudo install -m 755 usr/bin/python2-bashate ${BINDIR}/bashate
#!/bin/sh
#
# This script is public domain.
#
# This file is intended to install bashate via pip.
set -ex
if test -d /Library; then
# macOS
curl https://bootstrap.pypa.io/get-pip.py | sudo python
else
# Ubuntu
sudo apt-get install python-pip
fi
sudo -H pip install bashate
#!/bin/sh
# Wrapper around checkbashisms/shellcheck/whatever other shell checkers I can find
# Wrapper around shellcheck/whatever other shell checkers I can find
#
# Copyright (C) 2016 Austin English
# Copyright (C) 2016-2021 Austin English
#
# This software comes with ABSOLUTELY NO WARRANTY.
#
......@@ -47,82 +47,21 @@ trap 'rm -fr "$temp"' EXIT
# tests using bashate
test_bashate() {
if [ ! -x "$(command -v bashate 2>/dev/null)" ] && [ "${TRAVIS_OS_NAME}" = "osx" ]; then
echo "On OSX and bashate not available, skipping."
return
else
bashate="$(command -v bashate)"
#echo "======================== Begin bashate version info ==========================="
"${bashate}" --help > /dev/null || w_die "bashate must be installed!"
## bashate doesn't have a --version option (as of bashate-0.3.1)
#"$bashate" --version
#echo "======================== End bashate version info ==========================="
# Can't ignore individual things for now, filed bug:
# https://bugs.launchpad.net/bash8/+bug/1698088
# E006=line length check
# E010=do/while same line (in some embedded perl in winetricks)
# E044=Use [[ for non-POSIX comparisions
echo "Checking ${shellscript} with bashate:"
w_try "${bashate}" -i E006,E010,E044 "${shellscript}"
fi
}
# tests using checkbashisms
test_checkbashisms() {
if [ ! -x "$(command -v checkbashisms 2>/dev/null)" ] && [ "${TRAVIS_OS_NAME}" = "osx" ]; then
echo "On OSX and checkbashisms not available, skipping."
return
else
checkbashisms="$(command -v checkbashisms)"
echo "======================== Begin checkbashisms version info ==========================="
"${checkbashisms}" --help > /dev/null || w_die "checkbashisms must be installed!"
"${checkbashisms}" --version
echo "======================== End checkbashisms version info ==========================="
# Check if checkbashisms supports `command -v`. If not, warn, or if on travis, patch it:
cat > "${temp}/command.sh" <<_EOF
#!/bin/sh
command -v grep
_EOF
if ! "${checkbashisms}" --posix "${temp}/command.sh"; then
echo "Use a sed expression, to add checkbashisms support for 'command -v', based on the patch from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=733511"
echo "Creating a copy of the checkbashisms script, in ${temp}, to workaround this issue"
# /usr/bin/ (or /usr/local/bin on OSX) isn't writable on Travis, so we have to patch it in /tmp and use that:
(
sed -e '/qr'\''command\\s+\-\[\^p\]\\s'\''/ { ' -e 's|\[\^p\]|[^pvV]|' -e 's| \-p>| -p/-v/-V>|' -e '}' "${checkbashisms}" > "${temp}/checkbashisms.patched" && \
chmod +x "${temp}/checkbashisms.patched"
)
checkbashisms="${temp}/checkbashisms.patched"
else
echo "checkbashisms workaround not needed, using vanilla script"
fi
# FIXME: if we add a third patch, clean this up
# Check if checkbashisms supports `command -v`. If not, warn, or if on travis, patch it:
cat > "${temp}/kill.sh" <<_EOF
#!/bin/sh
sleep 5 & spid="$!"
kill -HUP \$spid
_EOF
if ! "${checkbashisms}" --posix "${temp}/kill.sh"; then
echo "Disabling the kill -signal warning"
echo "Creating a copy of the checkbashisms script, in ${temp}, to workaround this issue"
# /usr/bin/ (or /usr/local/bin on OSX) isn't writable on Travis, so we have to patch it in /tmp and use that:
(
sed -e '/bashisms.*kill/d' "${checkbashisms}" > "${temp}/checkbashisms.patched.kill" && \
chmod +x "${temp}/checkbashisms.patched.kill"
)
checkbashisms="${temp}/checkbashisms.patched.kill"
fi
echo "Checking ${shellscript} for bashisms:"
w_try "${checkbashisms}" --posix "${shellscript}"
fi
bashate="$(command -v bashate)"
#echo "======================== Begin bashate version info ==========================="
"${bashate}" --help > /dev/null || w_die "bashate must be installed!"
## bashate doesn't have a --version option (as of bashate-0.3.1)
#"$bashate" --version
#echo "======================== End bashate version info ==========================="
# Can't ignore individual things for now, filed bug:
# https://bugs.launchpad.net/bash8/+bug/1698088
# E006=line length check
# E010=do/while same line (in some embedded perl in winetricks)
# E044=Use [[ for non-POSIX comparisions
echo "Checking ${shellscript} with bashate:"
w_try "${bashate}" -i E006,E010,E044 "${shellscript}"
}
# check formatting, (no trailing whitespace, no tabs)
......@@ -152,20 +91,15 @@ test_formatting() {
# tests using shellcheck
test_shellcheck() {
if [ ! -x "$(command -v shellcheck 2>/dev/null)" ] && [ "${TRAVIS_OS_NAME}" = "osx" ]; then
echo "On OSX and shellcheck not available, skipping."
return
else
shellcheck="$(command -v shellcheck)"
shellcheck="$(command -v shellcheck)"
echo "======================== Begin shellcheck version info ==========================="
"${shellcheck}" --version > /dev/null || w_die "shellcheck must be installed!"
"${shellcheck}" --version
echo "======================== End shellcheck version info ==========================="
echo "======================== Begin shellcheck version info ==========================="
"${shellcheck}" --version > /dev/null || w_die "shellcheck must be installed!"
"${shellcheck}" --version
echo "======================== End shellcheck version info ==========================="
echo "Checking ${shellscript} with shellcheck:"
w_try "${shellcheck}" -s sh "${shellscript}"
fi
echo "Checking ${shellscript} with shellcheck:"
w_try "${shellcheck}" -s sh "${shellscript}"
}
# tests for linkcheck
......@@ -180,21 +114,6 @@ test_linkcheck() {
fi
}
test_travis_yml() {
if [ ! -x "$(command -v yq 2>/dev/null)" ]; then
echo "warning: yq unavilable, skipping .travis.yml validation"
else
yq="$(command -v yq)"
if [ -n "${yq}" ]; then
echo "yq available, validating .travis.yml"
yq . .travis.yml || true
else
echo "warning: yq not available, not validating .travis.yml"
fi
fi
}
###################################################################################################
# Test wrapper
......@@ -214,16 +133,10 @@ main() {
# really, this checks winetricks, to make sure it doesn't break linkcheck.sh:
test_linkcheck
# make sure yq (if present), can validate .travis_yml.
# Available in brew, not ubuntu (without snap), but if .travis_yml is invalid,
# travis won't run anyway. Only useful when running locally.
test_travis_yml
# Generic shellscript checks:
for shellscript in ${files_to_check}; do
test_formatting
test_bashate
test_checkbashisms
test_shellcheck
done
}
......
......@@ -102,21 +102,6 @@ BLACKLIST="${BLACKLIST}|ffdshow|python26|python27"
BLACKLIST="${BLACKLIST}|dirac"
# https://bugs.winehq.org/show_bug.cgi?id=50061 / https://github.com/Winetricks/winetricks/issues/1644
BLACKLIST="${BLACKLIST}|quicktime76"
# https://github.com/Winetricks/winetricks/issues/1638
BLACKLIST="${BLACKLIST}|dxvk_master"
# Travis CI is apparently blocking archive.org, which breaks several verbs:
# https://github.com/travis-ci/travis-ci/issues/6798
# Blacklist those verbs on those hosts:
# FIXME: setup another test target for torify, use it to d/l these?
ARCHIVE_ORG_BLACKLIST="atmlib|avifil32|cabinet|cmd|comctl32ocx|comdgl32ocx|gmdls|mdac27|mfc40|msflxgrd|mshflxgd"
ARCHIVE_ORG_BLACKLIST="${ARCHIVE_ORG_BLACKLIST}|msls31ms|msmask|msscript|msxml3|pdh|pngfilt|riched30"
ARCHIVE_ORG_BLACKLIST="${ARCHIVE_ORG_BLACKLIST}|richtx32|secur32|tabctl32|usp10|"
# See https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
if [ "${TRAVIS}" = "true" ] ; then
BLACKLIST="${ARCHIVE_ORG_BLACKLIST}|${BLACKLIST}"
fi
# Tests that fail under Xvfb
XVFB_DOTNET_BLACKLIST="dotnet11|dotnet11sp1|dotnet20|dotnet20sdk|dotnet20sp1|dotnet30|dotnet40|dotnet46"
......@@ -836,7 +821,7 @@ test_xvfb() {
export BLACKLIST
# Not test_quick() since some tests fail without proper X, but test_quick() doesn't respect $BLACKLIST
# Also, we don't really want to duplicate those tests twice, as this is for TravisCI where time is limited..
# Also, we don't really want to duplicate those tests twice, as this is for CI/CD where time is limited..
test_category dlls
test_category fonts
test_category settings
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment