Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Chatgpt can write ebuilds ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
nikolis
Apprentice
Apprentice


Joined: 21 Aug 2003
Posts: 200
Location: Athens

PostPosted: Tue Mar 21, 2023 9:11 pm    Post subject: Chatgpt can write ebuilds ? Reply with quote

Hi!
Have you asked the chatgpt to write you ebuilds?
Back to top
View user's profile Send private message
Dark _Templar
n00b
n00b


Joined: 02 Dec 2022
Posts: 29
Location: Prague

PostPosted: Tue Mar 21, 2023 10:14 pm    Post subject: Reply with quote

It is able to generate simple ebuilds for installing building simple projects or installing scripts, whitch need some minor adjustments. As for more complex ones, it still cant produce even remotly working script. Also urls are compleetly wrong, but in my opinion, it has potential.
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3139

PostPosted: Tue Mar 21, 2023 11:30 pm    Post subject: Reply with quote

I think we had like 2 topics about chatgpt already.

It's a LANGUAGE model, not a general AI. It puts together words that often go together. It has no concept of meaning behind those words. There is no depth to whatever output it generates.
Which is what made it super funny when colleges started complaining about automatically generated thesis being indistinguishable from actual studies. I really shows what humanities are worth :lol:

No worries, if ya any good at all, it ain't taking yer work
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30922
Location: here

PostPosted: Wed Mar 22, 2023 6:27 am    Post subject: Reply with quote

I tried now.
Q: "write an ebuild for gentoo of sphinx-intl"
R:
Code:
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

PYTHON_COMPAT=( python3_6 )
inherit distutils-r1

DESCRIPTION="Internationalization extension for Sphinx documentation generator"
HOMEPAGE="https://pypi.org/project/sphinx-intl/"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="test"

RDEPEND="dev-python/babel[${PYTHON_USEDEP}]"
DEPEND="${RDEPEND}
       test? ( >=dev-python/sphinx-1.1.2[${PYTHON_USEDEP}] )"

# Test suite requires internet connection.
RESTRICT=test

python_prepare_all() {
    sed -i 's:^_\([^_]\+_\)$:..\1:' sphinx_intl/__init__.py || die
    sed -i "/locale.compile/d" sphinx_intl/__init__.py || die
}

python_test() {
    esetup.py test
}

python_compile() {
    # Build egg first to create documentation.
    python_export setuptools
    python_export sphinx
    esetup.py build_sphinx
    esetup.py egg_info --egg-base "${ESRC}"/build
    esetup.py build ${BUILD_ARGS} --executable="${EPYTHON}"
}

python_install_all() {
    local LANGUAGES="ca de es fr hu it ja ko nl pl pt_BR ru sv tr uk zh_CN zh_TW"
    local languages=""

    for l in ${LANGUAGES}; do
        use linguas_${l} && languages+=" ${l}"
    done

    # Build documentation first.
    esetup.py build_sphinx

    # Copy conf.py to build dir for localized builds.
    cp sphinx_intl/conf.py build/sphinx || die

    # Install egg-info first.
    distutils-r1_python_install_all

    # Install Sphinx components.
    local components="sphinx-build sphinx-intl"

    for c in ${components}; do
        newbin "build/scripts-${PYVER}/${c}" "${PN}-${c}"
    done

    # Install translations.
    local lang

    for lang in ${languages}; do
        insinto "/usr/share/${PN}/locale/${lang}/LC_MESSAGES"
        doins "build/locale/${lang}/LC_MESSAGES/${PN}.mo"
    done

    # Install localization scripts.
    insinto "/usr/share/${PN}"
    doins sphinx_intl/*.{po,sh}

    # Install examples.
    insinto "/usr/share/doc/${PF}"
    doins -r examples

    # Install manpages.
    newman "build/sphinx/man/sphinx-intl.1" "${PN}-sphinx-intl.1"
}

My working ebuild
Code:
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{9..11} )
DISTUTILS_USE_PEP517=setuptools
inherit distutils-r1

DESCRIPTION="Utility tool to translate Sphinx generated document."
HOMEPAGE="https://github.com/sphinx-doc/sphinx-intl https://pypi.org/project/sphinx-intl/"
SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"

LICENSE="BSD-2"
SLOT="0"
KEYWORDS="~amd64"
IUSE="test"
# use tox that seems not supported in distutils-r1 eclass
RESTRICT="test"

RDEPEND="dev-python/Babel[${PYTHON_USEDEP}]
        dev-python/click[${PYTHON_USEDEP}]
        dev-python/sphinx[${PYTHON_USEDEP}]
"
BDEPEND="
        dev-python/setuptools[${PYTHON_USEDEP}]"

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
mrbassie
l33t
l33t


Joined: 31 May 2013
Posts: 772
Location: over here

PostPosted: Wed Apr 26, 2023 9:21 pm    Post subject: Reply with quote

szatox wrote:
I think we had like 2 topics about chatgpt already.

It's a LANGUAGE model, not a general AI. It puts together words that often go together. It has no concept of meaning behind those words. There is no depth to whatever output it generates.
Which is what made it super funny when colleges started complaining about automatically generated thesis being indistinguishable from actual studies. I really shows what humanities are worth :lol:

No worries, if ya any good at all, it ain't taking yer work


Learn to mine?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum