Skip to content

Commit

Permalink
feat: add support for Meson build system
Browse files Browse the repository at this point in the history
resolves #2
  • Loading branch information
tfuxu committed Oct 27, 2022
1 parent 8eb6966 commit 15f3fde
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 14 deletions.
59 changes: 45 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
# Win32 Details
![PyPI](https://img.shields.io/pypi/v/win32-details)
![License](https://img.shields.io/github/license/tfuxu/win32-details)

**Win32 Details** is an additional page in Properties dialog named `Details`, similar to that from Windows File Explorer. It allows to conveniently display a specific details about .exe files within comfort of your file browser.
**Win32 Details** is an additional page in Properties dialog named `Details`, similar to that from Windows File Explorer. It allows to conveniently display a specific details about .exe files within a comfort of your file browser.

![win32-details v0.1](https://raw.githubusercontent.com/tfuxu/win32-details/main/data/images/win32-details-screenshot-1.png)

## How to use it
Just right-click any .exe file, go to Properties, and click `Details` tab.

## Installation
### Requirements
* **Python** >= 3.6,
* Probably a recent version of **Nautilus 3.x**, or **Nautilus 4x**,
* [nautilus-python](https://wiki.gnome.org/Projects/NautilusPython),
* Copy of [exiftool](https://github.com/exiftool/exiftool) (required by PyExifTool),
* [PyExifTool](https://pypi.org/project/PyExifTool/)

### From PyPI
Win32 Details can be installed system-widely or just for the current user.

Expand All @@ -36,37 +30,74 @@ Close currently opened Nautilus instances to load the extension:
nautilus -q
```

### From source
Win32 Details can be installed system-widely or just for the current user.
## Building from source
### Prerequisites
The following packages are required to build win32-details:

* **Python** >= 3.6,
* Probably a recent version of **Nautilus 3.x**, or **Nautilus <= 42.x**,
* [nautilus-python](https://wiki.gnome.org/Projects/NautilusPython),
* Copy of [exiftool](https://github.com/exiftool/exiftool) (required by PyExifTool),
* [PyExifTool](https://pypi.org/project/PyExifTool/)
* Meson and Ninja build systems (only needed for [Using Meson](#using-meson) build option)

Required Python libraries:
```
pip install -r requirements.txt
```

Clone the repository, and cd to it:
### Build instructions
Clone the repository:
```
git clone https://github.com/tfuxu/win32-details.git
cd win32-details
```

User install:
#### As a library:
Local installation:
```
pip3 install --user .
win32-details --install-user
```

System-wide install:
System-wide installation:
```
sudo pip3 install .
sudo win32-details --install-system
```

#### Using Meson:
Local installation:
```
meson builddir --prefix="$HOME/.local"
ninja -C builddir install
```

System-wide installation:
```
meson builddir --prefix=/usr
sudo ninja -C builddir install
```

> **Warning**
> If you get a `Directory already configured` message when running `meson builddir` command, you can append to this command `--wipe` option to clean build directory before configuration.
Close currently opened Nautilus instances to load the extension:
```
nautilus -q
```

## License
<p>
<img src="https://www.gnu.org/graphics/gplv3-with-text-136x68.png" alt="GPLv3 logo" align="right">
This repository is licensed under the terms of the GNU GPLv3 license. You can find a copy of the license in the LICENSE file.
</p>

## Changelog
* **0.4:**
* Add a `MD5 Hash` row
* Allow user to copy values from rows (if row is selected, click left one time to select text)
* Add setup.py for packaging to PyPI
* Create a small CLI tool for easier installing (based on [Nautilus Terminal](https://github.com/flozz/nautilus-terminal/blob/master/nautilus_terminal/__main__.py))
* **0.1:**
* Initial release of Win32 Details
* Initial release of Win32 Details
30 changes: 30 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
project('win32-details',
version: '0.4',
meson_version: '>= 0.59.0',
default_options: [ 'warning_level=2',
'werror=false',
]
)

# Import modules
python = import('python')

# Nautilus extension directory
EXTENSIONS_DIR = join_paths(get_option('prefix'), get_option('datadir'), 'nautilus-python/extensions')

dependency('glib-2.0')
dependency('gtk+-3.0')
dependency('pygobject-3.0', version: '>= 3.40.0')

# Check if python3 is installed
PY_INSTALLDIR = python.find_installation('python3', required: true)

# Check if exiftool is installed
find_program('exiftool', required: true)

# Install configuration data
conf = configuration_data()
conf.set('EXTENSIONS_DIR', EXTENSIONS_DIR)

# Subdirs
subdir('win32_details')
16 changes: 16 additions & 0 deletions win32_details/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copy files to Python libraries directory (disable for now)
#sources = [
# '__init__.py',
# 'cli.py',
# 'win32_details.py'
#]
#PY_INSTALLDIR.install_sources(sources, subdir: 'win32_details')

# Copy extension code to Nautilus extensions directory
configure_file(
input: 'win32_details.py',
output: 'win32_details.py',
configuration: conf,
install: true,
install_dir: EXTENSIONS_DIR
)

0 comments on commit 15f3fde

Please sign in to comment.