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

Installation issue #262

Closed
Spixmaster opened this issue Aug 14, 2023 · 4 comments
Closed

Installation issue #262

Spixmaster opened this issue Aug 14, 2023 · 4 comments

Comments

@Spixmaster
Copy link

Spixmaster commented Aug 14, 2023

I am the packager for Arch Linux of this software and having a hard time writing an installation script. No Python files are installed. Strangely, the error seems not to occur to every user but I have at least one confirmation from another user plus I tried it out on two of my computers which both resulted in an erroneous installation.

The package can be found here.

PKGBUILD

#!/usr/bin/env bash
# shellcheck disable=SC2034
# shellcheck disable=SC2154
# The PKGBUILD for Maison.
# Maintainer: Matheus <matheusgwdl@protonmail.com>
# Contributor: Matheus <matheusgwdl@protonmail.com>

readonly _pkgname="maison"

pkgname="python-maison"
pkgver="1.4.0"
pkgrel="1"
pkgdesc="Read settings from config files."
arch=("any")
url="https://github.com/dbatten5/${_pkgname}"
license=("MIT")
depends=("python" "python-click" "python-pydantic" "python-toml")
makedepends=("python-build" "python-installer" "python-poetry")
source=("${pkgname}-v${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
sha512sums=("a2dbc26137973e7c15bb05af1aa6b8c1f48c2a4e970a1bdd6fb9b52d8205a313068ca89bc9570fa2aec2e1dd44e1b95f2f354bb4a8a46d1fec82f8522827f02e")

build()
{
    cd "${srcdir}"/"${_pkgname}"-"${pkgver}"/ || exit 1
    python -m build -nw
}

package()
{
    # Assure that the directories exist.
    mkdir -p "${pkgdir}"/usr/share/doc/"${pkgname}"/
    mkdir -p "${pkgdir}"/usr/share/licenses/"${pkgname}"/

    # Install the software.
    cd "${srcdir}"/"${_pkgname}"-"${pkgver}"/ || exit 1
    python -m installer -d "${pkgdir}" "${srcdir}"/"${_pkgname}"-"${pkgver}"/dist/*.whl

    # Install the documentation.
    install -Dm644 "${srcdir}"/"${_pkgname}"-"${pkgver}"/README.md "${pkgdir}"/usr/share/doc/"${pkgname}"/
    cp -r "${srcdir}"/"${_pkgname}"-"${pkgver}"/docs/* "${pkgdir}"/usr/share/doc/"${pkgname}"/
    find "${pkgdir}"/usr/share/doc/"${pkgname}"/ -type d -exec chmod 755 {} +
    find "${pkgdir}"/usr/share/doc/"${pkgname}"/ -type f -exec chmod 644 {} +

    # Install the license.
    install -Dm644 "${srcdir}"/"${_pkgname}"-"${pkgver}"/LICENSE.rst "${pkgdir}"/usr/share/licenses/"${pkgname}"/
}

installed files

❯ rm -r ~/.cache/paru/clone/python-maison/
❯ paru -S python-maison
...
❯ pacman -Ql python-maison
python-maison /usr/
python-maison /usr/bin/
python-maison /usr/bin/maison
python-maison /usr/lib/
python-maison /usr/lib/python3.11/
python-maison /usr/lib/python3.11/site-packages/
python-maison /usr/lib/python3.11/site-packages/maison-1.4.0.dist-info/
python-maison /usr/lib/python3.11/site-packages/maison-1.4.0.dist-info/LICENSE.rst
python-maison /usr/lib/python3.11/site-packages/maison-1.4.0.dist-info/METADATA
python-maison /usr/lib/python3.11/site-packages/maison-1.4.0.dist-info/RECORD
python-maison /usr/lib/python3.11/site-packages/maison-1.4.0.dist-info/WHEEL
python-maison /usr/lib/python3.11/site-packages/maison-1.4.0.dist-info/entry_points.txt
python-maison /usr/share/
python-maison /usr/share/doc/
python-maison /usr/share/doc/python-maison/
python-maison /usr/share/doc/python-maison/README.md
python-maison /usr/share/doc/python-maison/contributing.md
python-maison /usr/share/doc/python-maison/index.md
python-maison /usr/share/doc/python-maison/reference.md
python-maison /usr/share/doc/python-maison/requirements.txt
python-maison /usr/share/doc/python-maison/usage.md
python-maison /usr/share/licenses/
python-maison /usr/share/licenses/python-maison/
python-maison /usr/share/licenses/python-maison/LICENSE.rst
@dbatten5
Copy link
Owner

Hi @Spixmaster thanks for raising an issue. I'm afraid I have no experience at all in packaging software so I'm not sure how much help I can be. This repo was scaffolded using this cookiecutter and to the best of my knowledge I haven't touched any packaging parts of the repo, maybe it's worth raising an issue there to see if anyone's had the same problem?

@Spixmaster
Copy link
Author

I fixed the issue. It was really odd. The problem was caused by the option -n for the command python -m build.

@dbatten5
Copy link
Owner

Weird! Glad to hear you've fixed the issue though

@Spixmaster
Copy link
Author

I have had a different software where the same issue occurred so it is not something only this software is affected by.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants