CauldronDevelopmentLLC / CAMotics

Open-Source Simulation & Computer Aided Machining - A 3-axis CNC GCode simulator
Other
602 stars 138 forks source link

Issuess on Manjaro distribution with MIME types #363

Closed phdxpahob closed 2 years ago

phdxpahob commented 2 years ago

Hello everyone!

I am using Manjaro linux, but as far as I know it is tightly based on Arch, so it should have the same issue; given that it is not critical to compilation probably it's not reported yet.

When I build the package with yay/makepkg and installing it, it gives the following output:

$ sudo pacman -U camotics-git-r954.c0072b6-2-x86_64.pkg.tar.zst 
[sudo] password for user: 
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) camotics-git-r954.c0072b6-2

Total Installed Size:  50.26 MiB
Net Upgrade Size:       0.11 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                         [#######################################] 100%
(1/1) checking package integrity                                       [#######################################] 100%
(1/1) loading package files                                            [#######################################] 100%
(1/1) checking for file conflicts                                      [#######################################] 100%
(1/1) checking available disk space                                    [#######################################] 100%
:: Processing package changes...
(1/1) upgrading camotics-git                                           [#######################################] 100%
:: Running post-transaction hooks...
(1/3) Arming ConditionNeedsUpdate...
(2/3) Updating the MIME type database...
I/O error : Is a directory
/usr/share/mime/packages/camotics.xml:1: parser error : Document is empty

^
Failed to parse '/usr/share/mime/packages/camotics.xml'
(3/3) Updating the desktop file MIME type cache...

Which is not a critical error but somehow it is not "clean" install.

To resolve this issue one must either correct it manually in /usr/share/mime/packages/ to remove the directory and rename the file mime.xml with it, or go to the build directory and modify SConstruct, line 285:

285 - env.Install(prefix + '/share/mime/packages/camotics.xml', 'mime.xml')
285 + env.Install(prefix + '/share/mime/packages', 'camotics.xml')

This resolves the failure to update the MIME database on package installation(s).

$ sudo pacman -U camotics-git-r954.c0072b6-2-x86_64.pkg.tar.zst 
[sudo] password for user: 
loading packages...
warning: camotics-git-r954.c0072b6-2 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) camotics-git-r954.c0072b6-2

Total Installed Size:  50.26 MiB
Net Upgrade Size:       0.00 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                         [#######################################] 100%
(1/1) checking package integrity                                       [#######################################] 100%
(1/1) loading package files                                            [#######################################] 100%
(1/1) checking for file conflicts                                      [#######################################] 100%
(1/1) checking available disk space                                    [#######################################] 100%
:: Processing package changes...
(1/1) reinstalling camotics-git                                        [#######################################] 100%
:: Running post-transaction hooks...
(1/3) Arming ConditionNeedsUpdate...
(2/3) Updating the MIME type database...
(3/3) Updating the desktop file MIME type cache...

Version and system information:

*********************************** CAMotics ***********************************
    Version: 1.2.2
     Author: Joseph Coffland <joseph@cauldrondevelopment.com>
        Org: Cauldron Development LLC
  Copyright: 2011-2019, Joseph Coffland
   Homepage: https://camotics.org/
    License: https://www.gnu.org/licenses/gpl-2.0.txt
       Date: Apr 2 2022
       Time: 19:13:45
   Revision: c0072b645eb3447d66cbdb7bc2611c64b02439eb
     Branch: makepkg
   Compiler: GNU 11.2.0
    Options: -faligned-new -std=c++14 -fsigned-char -Wno-deprecated-declarations
             -ffunction-sections -fdata-sections -O3 -funroll-loops -fno-pie
             -fPIC
   Platform: linux 5.4.184-1-MANJARO
       Bits: 64
       Mode: Release
************************************ CBang *************************************
       Date: Apr 2 2022
       Time: 19:52:42
   Revision: d57fd050c8b2c72d48a920394de8ef57bc8eda0e
     Branch: makepkg
   Compiler: GNU 11.2.0
    Options: -faligned-new -std=c++14 -fsigned-char -ffunction-sections
             -fdata-sections -O3 -funroll-loops -fno-pie -fPIC
   Platform: linux 5.4.184-1-MANJARO
       Bits: 64
       Mode: Release
************************************ System ************************************
        CPU: AMD Embedded G-Series GX-420GI Radeon R7E
     CPU ID: AuthenticAMD Family 21 Model 96 Stepping 1
       CPUs: 4
     Memory: 7.55GiB
Free Memory: 2.87GiB
    Threads: POSIX_THREADS
 OS Version: 5.4
Has Battery: false
 On Battery: false
 UTC Offset: 3
        PID: 271959
        CWD: /home/user
        DPI: 96
********************************************************************************

Since I'm not sure how it is on other distributions (even variants of Arch based), I'm posting here for discussion. Also, please notify me if addtional information is required.

hpmachining commented 2 years ago

I updated the Arch aur package with this patch. It should install clean now.

diff --git a/SConstruct b/SConstruct
index 369949a..bbe2f42 100644
--- a/SConstruct
+++ b/SConstruct
@@ -282,7 +282,7 @@ for target in docs + ['examples', 'machines']:
 env.Install(prefix + '/share/camotics/', 'tpl_lib')
 env.Install(prefix + '/share/pixmaps', 'images/camotics.png')
 env.Install(prefix + '/share/applications', 'CAMotics.desktop')
-env.Install(prefix + '/share/mime/packages/camotics.xml', 'mime.xml')
+env.InstallAs(prefix + '/share/mime/packages/camotics.xml', 'mime.xml')

 description = '''CAMotics is an Open-Source software which can simulate
 3-axis NC machining. It is a fast, flexible and user friendly simulation